Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I store a bit in the database and want to return a string "checked" 1

Status
Not open for further replies.

mit99mh

Programmer
Sep 24, 2002
246
GB
I store a bit in the database and want to return a string "checked" if the bit is 1 and nothing / zero length string if the bit value is zero - is it possible to do this?

Any help appreciated
 
You could use a case statement

select 'status' =
CASE yourbitfield
WHEN 1 THEN 'checked'
ELSE 'not checked'
END
from yourtable

Andy
 
thanks that really set me on the right track
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top