View Full Version : what to use instead of "if"?


PaulSpell
01-12-2006, 02:29 AM
I'm trying to write a pass-through query that contains anumber of IIf statements. SQL Server doesn't appear to like them.

Can anyone please tell me what the syntax should be or what function to use in their place?


Thanks.

pdx_man
01-12-2006, 09:02 AM
Case When ....
When ...
When ...
Else ...
End

PaulSpell
01-13-2006, 01:00 AM
Thanks!

Do you happen to know whether there is an equivalent of the nz() function as well?

FoFa
01-13-2006, 06:53 AM
ISNULL(Column,ValueToReturn if null) as ColumnAlias