When multiple screening statements are used in a report requests, FOCUS treats them as though they are connected with AND as long as they are in a single path. Sometimes however, OR criteria is required. This is referred to as a compound logical expression.
The syntax for a compound screening statement is:
WHERE (criteria) OR (criteria)
For example, the screening statements below will not select any records because there is an implied AND condition and payments for CBID R11 are not issued as payment type L (student pay):
IF (PH:CBID EQ 'R11')
IF (PH:PAYMETYP EQ 'L')
To re-write the selection statements so that an OR condition is stated, use the WHERE command and put parentheses around each set of criteria, separated by the OR command:
WHERE (PH:CBID EQ 'R11') OR (PH:PAYMETYP EQ 'L')
Note the following:
-
Compound screening statements cannot be written using the IF command.
-
FOCUS evaluates logical AND conditions before logical OR conditions.
-
Place parentheses around each simple expression to make the screening statement more readable. This is especially true when mixing literal OR tests with logical AND and OR conditions.
Related Topics: Where Screening Statements, If Versus Where