There is nothing like IIF in TSQL.
There is, however, the CASE expression which is considerably more powerful. There are two forms:
Code:
Simple CASE function:
CASE input_expression
WHEN when_expression THEN result_expression
[ ...n ]
[
ELSE else_result_expression
]
END
Searched CASE function:
CASE
WHEN Boolean_expression THEN result_expression
[ ...n ]
[
ELSE else_result_expression
]
END
See BOL for details, or tell us what you are trying to do, and maybe we can show you an equivalent (or better) syntax.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com