IIF( ) Function Example

The following example uses IIF( ) to check if the notes field in the employee table is empty. If it is empty, "No description" is displayed; otherwise, the contents of the memo field are displayed.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE employee  && Open Employee table
CLEAR

SCAN
   ? IIF(EMPTY(notes), 'No notes', notes)    && Empty memo field?
ENDSCAN