IIF
IIF is an acronym used in programming and data query languages to denote a conditional expression that returns one of two values depending on a condition. It is commonly described as an "immediate if" or an if-then-else function, and its precise behavior varies by language and implementation.
In Visual Basic and its derivatives (VBA, VB6), the IIf function takes three arguments: IIf(condition, valueIfTrue,
SQL Server provides a built-in IIF function starting with SQL Server 2012: IIF(condition, trueValue, falseValue). It
Other environments, such as Crystal Reports formula language, also support IIF with the same general syntax:
Alternatives to IIF include the CASE expression in SQL and the ternary operator in many programming languages.