Link to home
Start Free TrialLog in
Avatar of jon100
jon100

asked on

Easy SQL: Return 'Demo' or 'Live' - instead of True or Fals on bit field

SQL Server 2000.

I have a bit field - that returns True of False (obviously) (eg SELECT mybitfield from mytable).

returns

True
False
True

How can I return, say, 'Demo' if true is returned - and 'Live' if false?

Thanks!...
Avatar of auke_t
auke_t
Flag of Netherlands image

select
  case when mybitfield = 1 then 'Demo' else 'Live' end
from
  mytable
Avatar of jon100
jon100

ASKER

thanks.

one more quick thing - how can i get that to return a column heading?
ASKER CERTIFIED SOLUTION
Avatar of auke_t
auke_t
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jon100

ASKER

excellent - thanks a lot