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.
| Author |
Topic |
|
suchiate
Starting Member
33 Posts |
Posted - 2007-03-10 : 08:07:57
|
| Hey guys,I would like to find out if I could change the values due to certain conditions in a select statement without using cursors such that:I have a bit column, name bitAct for example, if it is true, i wanna display Activated instead of true and Deactivated instead of false.Thanks lot in advance. Hope you guys can help me out. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-10 : 08:14:50
|
[code]select case when bitAct = 1 then 'Activated' when bitAct = 0 then 'Deactivated' else '' endfrom yourtable[/code] KH |
 |
|
|
spejbl
Starting Member
28 Posts |
Posted - 2007-03-10 : 08:16:23
|
orSELECT CASE bitAct WHEN 0 THEN 'Deactivated' WHEN 1 THEN 'Activated' ELSE '' ENDFROM dbo.YourTable --kbhttp://kbupdate.info/ |
 |
|
|
suchiate
Starting Member
33 Posts |
Posted - 2007-03-10 : 08:23:18
|
| Thanks alot guys, it helped big time =) |
 |
|
|
|
|
|