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)
 Condition in a select statement

Author  Topic 

agniwoni
Starting Member

28 Posts

Posted - 2007-07-09 : 10:25:36
Hi,
Is there any way to use IIF statement in SELECT clause?

Select IIF(condition, value when true, value when else)

Thanks 4 any help!
Regards!

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-09 : 10:34:10
use CASE WHEN


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

agniwoni
Starting Member

28 Posts

Posted - 2007-07-09 : 10:46:58
quote:
Originally posted by khtan

use CASE WHEN


KH
[spoiler]Time is always against us[/spoiler]





thanks! i promise i'll consider reading booksonline :)
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-09 : 10:48:09
quote:
Originally posted by agniwoni

quote:
Originally posted by khtan

use CASE WHEN


KH
[spoiler]Time is always against us[/spoiler]





thanks! i promise i'll consider reading booksonline :)






KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -