Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 true or false in select query

Author  Topic 

palak
Yak Posting Veteran

55 Posts

Posted - 2009-06-12 : 12:18:39
Select
Case R.IsSpecialNeeds WHEN 1 Then 'Yes' when 0 Then 'No'
END as IsSpecialNeeds from Registration

If I need to change from True or False its not working

Case R.IsSpecialNeeds WHEN True Then 'Yes' when False Then 'No'
END as IsSpecialNeeds from Registration

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2009-06-12 : 12:49:40
Is the column IsSpecialNeeds a BIT or something else? How is it not working? Do you get an error or unexpected results?
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-06-12 : 13:03:00
Case R.IsSpecialNeeds WHEN 'True' Then 'Yes' when 'False' Then 'No'
END as IsSpecialNeeds from Registration

You just need the single quotes around 'true' and 'false'

Jim
Go to Top of Page

palak
Yak Posting Veteran

55 Posts

Posted - 2009-06-12 : 13:12:20
i got it!! thanks al...
Go to Top of Page
   

- Advertisement -