IIF


Overview
The IIF function is a shorthand for "Immediate If." It returns one of two specified values depending on whether a given condition is true or false. It's employed within queries to conditionally produce a value based on a logical test.

Prototype

Example
round-pushpin Selects documents from the FlatTranslate schema and determines if the English field is equal to 'cats'.
SELECT
    English,
    IIF(Equals(English, 'cats'), 'YES!', 'no...') as 'IsCats?'
FROM
    WordList:FlatTranslate
WHERE
    English LIKE '%cats'

See also

Related