Skip to content

IIF ​

Returns values depending on the condition given.

Reporting Area(s) ​

General

Required Parameters ​

  1. Condition to evaluate (i.e. pytype='3', rgcancel, empty(nmcomm))
  2. Return value if condition is true (i.e. "Canceled", pyamt)
  3. Return value if condition is false (i.e. "", pyamt)

Optional Parameters ​

None

Example(s) ​

IIF(rgcancel,"Canceled","") returns the word 'Canceled' if registration is canceled, otherwise returns nothing

IIF(pytype='3', "Billing", pyamt) returns the word 'Billing' if the pay type is billing, otherwise returns the payment amount

IIF(empty(nmcomm), "No Comments", nmcomm) returns 'No Comments' if no comments have been

Notes ​

Standard FoxPro Function

IIF statements consist of 3 parts: 1) the condition to evaluate, 2) what to return if the condition is true, and 3) what to return if the condition is false.