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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert bit column to Y/N 1

Status
Not open for further replies.

developer77

Programmer
Nov 20, 2006
18
US

I have a table that declares the USCitizen column as a bit. The values in there are either 1 or 0. When I select from this column, it displays 1 or 0. Is there a way for me to convert this so that it displays Y or N instead?

Thanks
 
Code:
Select Case When USCitizen = 1 Then 'Y' 
            When UsCitizen = 0 Then 'N'
            Else 'Unknown' 
            End As UsCitizen
From   Table...

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
You're welcome.

I decided to put the 'unknown' stuff in there to accomodate NULLS. If you don't have any nulls, you'll never get 'unknown' for that column.

I'm glad it helped.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top