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 2000 Forums
 Transact-SQL (2000)
 converting int value to boolean

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-03 : 09:02:53
chitts writes "Dear SQL Team,
I got a quick question. I have a field with int data type but the values are 0 or 1. I need to convert to 0 to no and 1 to yes.
Is there any built in function in SQL Server 2000.


Thanks
Chitts"

dsdeming

479 Posts

Posted - 2002-07-03 : 09:11:57
See CAST or CONVERT in BOL. You need to convert the value to the bit datatype.

Go to Top of Page

nivaskhan
Starting Member

17 Posts

Posted - 2002-07-03 : 09:18:02
I hope if this helps...

Select Charvalue =
Case Columnname
when 0 then 'NO'
else 'YES'
End
From TableName

Here the values are Char and not Boolean .

Regards,
Nivas
Go to Top of Page
   

- Advertisement -