IIf
Overview
Returns the second parameter if the first parameter evaluates True. Returns the third parameter if the first parameter evaluates False.Syntax
IIf(1, 2, 3)
| Ordinal | Type | Description | |
|---|---|---|---|
| 1 | string | Required | Any function or expression that returns a true or false result. |
| 2 | string | Required | Value to return if the expression evaluates True |
| 3 | string | Required | Value to return if the expression evaluates False |
Usage
%%=IIF(EMPTY(@VAR),'123',@VAR)=%%
The system returns the value 123 if the @VAR variable is empty and returns the value of @VAR if it exists.