SQL IIF Function

Example

Return “YES” if the condition is TRUE, or “NO” if the condition is FALSE:

SELECT IIF(500<1000, 'YES', 'NO');

Definition and Usage

The IIF() function returns a value if a condition is TRUE, or another value if a condition is FALSE.

Syntax

IIF(condition, value_if_true, value_if_false)

Continue reading SQL IIF Function