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)
 How to use if or iif

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-12-19 : 09:03:14
AdyJoss writes "how to use if or iif in query like in ms.access

example=select iif(a=true,'A','B') as MyOpt from Customer
for this example how i use in sqlServer

thank's"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-19 : 09:05:52

Select case when a=true then 'A' else 'B' end as MyOpt from Customer


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -