November 25, 2008 at 1:29 pm
I have a bit column and I'm creating a report and its returning True or False based on 0 or 1 in the column. How do I convert True/False to Yes/No in my query to display in the report?
November 25, 2008 at 2:11 pm
thanks Ken that worked for me!
November 25, 2008 at 2:15 pm
Keep in mind that I am counting a NULL value as No also.
November 25, 2008 at 2:29 pm
hmmm how would I handle a NULL values?
November 25, 2008 at 2:50 pm
You just add in the extra handler:
Select Case @TST1 When 1 Then 'Yes' Else 'No' END ,
Case @tst2 When 1 Then 'Yes' Else 'No' END
Changes to:
[font="Courier New"]SELECT CASE @tst1 WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
ELSE 'Unknown'
END,
CASE @tst2 WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
ELSE 'Unknown'
END
[/font]
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply