# iif

### iif(test, trueResult, falseResult)

if the test is TRUE, returns the trueResult, otherwise returns the falseResult.

## Arguments

Argument | Data Type | Description
test | boolean | an expression that resolves to true or false
trueResult, falseResult | expressions | The expression is evaluated and the result returned

## Returns

Either the output of the trueResult expression or the falseResult expression, depending on the value of test.

## Description

Either the output of the trueResult expression or the falseResult expression, depending on the value of test.

## Examples

Example | Returns | Description
iif(true, "TRUE", "FALSE") | "TRUE" |
iif(1 > 2, 3, 4) | 4 | Tests if 1 is greater than 2; as this is FALSE< it returns the second expression - 4.
iif(date() - 5 < date(), "less than", "greater than") | "less than" | Test if the current date less 5 days is less than the current date; as this is TRUE, it returns the first expression - "less than"

## See Also

None.