Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF equivalent in SQL 2000 2

Status
Not open for further replies.

hsingh1981

Programmer
Apr 8, 2008
56
0
0
GB
Hi all,

I have this iif statement but i can't find the equivalent in sql....

Code:
Action: IIf([Action] Is Null Or [Action]='',Null,'Action: ' & [Action])

What would that be in SQL Programming?

cheers

 
As an add on to Daniels solution you can also use:

(case
when coalesce(action,'')=''
then null

when coalesce(action,'')='something else'
then 'another output'


else action
end) action

Which is the alternative to nested iif statements.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top