Introduction to ENFORM

Restricting the Information That Appears on a Report
Using ENFORM to Produce Complete Reports
4–8 058051 Tandem Computers Incorporated
Figure 4-7. Qualifying a Report With WHERE
SUPPNUM PARTNUM PARTCOST
1 212 92000.00
244 87000.00
6 4102 14500.00
4103 24500.00
This report is the same as Figure 4-6, with one exception—all records where the
partcost field did not satisfy the condition greater than 9000 are not in the report.
WHERE does not restrict you to simple greater than or less than conditions; it can be
followed by any logical expression that can be tested for a true or not true condition.
These expressions can be complex and sophisticated, which allows you to be very
precise about qualifying information to be selected. See the description of logical
expressions in the ENFORM Reference Manual for a detailed description of how to
construct a logical expression.
An example of using IF/THEN/ELSE to qualify information and to print alternate
values for a field is entering:
>LIST BY suppnum, partnum,
(IF partcost GREATER THAN 9000 THEN partcost ELSE
BLANKS);
to generate the report in Figure 4-8.
Figure 4-8. Qualification Using IF/THEN/ELSE
SUPPNUM PARTNUM PARTCOST
1 212 92000.00
244 87000.00
6201
7301
6 4102 14500.00
4103 24500.00
10 7102
In one way, this report is like the one in Figure 4-7—a condition has been tested
(partcost greater than 9000) and records have been printed for fields that satisfy the
condition. However, all of the other records in the database have also been printed,
and the partcost fields have been printed as blanks for records that did not satisfy the
condition. Again, see the ENFORM Reference Manual for all of the ways you can use
IF/THEN/ELSE in conjunction with logical expressions.