Progress
Report Builder
User’s Guide
IIF
Evaluates a condition and returns one of two values, depending on whether the condition is TRUE or FALSE. IIF is similar to the IF. . .THEN. . .ELSE function in the 4GL.
SYNTAX
condition
A logical expression (a constant, field name, or expression that results in a logical value).
true-value
A value (a constant, field name, or expression) that Report Builder returns if the condition is TRUE.
false-value
A value (a constant, field name, or expression) that Report Builder returns if the condition is FALSE.
NOTE: True-value and false-value must be the same data type. However, they do not have to be the same data type as the condition.True-value and false-value can be memo fields. By using a memo field as the true-value and empty quotation marks (" ") as the false-value, you can use IIF to return an empty memo field without including an empty field in your text memo file.
NOTE
You can use the CASE statement to compress nested IIF statements.
EXAMPLETo print the title of each name in a mailing label report based on the gender of the addressee, create this field:
To print “Missing” if the character field, Title, is empty or NULL and “Okay” if it contains information, create this field:
To print the Thanks memo field if DUE is 0, or memo field Sendcash if DUE is not 0, create this field:
To return the string “See Comment” if Comment contains characters and the string “No Comment” if Comment does not contain characters, create this field:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |