Converting binary to int

I've got a SQL database which has a binary column containing a number (0 to 6). I want to use this number on an ASP page but what I get in the recordset doesn't seem tyo be any good.

I've tried selecting it as binary and also using CAST and CONVERT e.g. convert(int, status) but although the result can be output (e.g. response.write) I can't seem to use it in expressions. It behaves as null

Why How ... what do I do to get around it?
DansimmoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Duane LawrenceCommented:

convert(int, isnull(status,0))

Duane
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LowfatspreadCommented:
how big is the binary column
can you post the Table ddl which created it...
0
Duane LawrenceCommented:
see if you have a lot of nulls in the column

select * from tablename where status is null

Duane
0
DansimmoAuthor Commented:
Its a very big table.

I checked and there aren't any nulls. The puzzling bit is that the ASP page seems to be able to print the value but when you multiply, add, concatenate or anything it behaves as if null.
0
DansimmoAuthor Commented:
sorry all ... big case of brain fade. wasn't  referring to recordset when multiplying etc. Free points!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.