WHEN |
![]() ![]() ![]() |
The WHEN keyword introduces a selection clause for a multi-valued field.
Format
WHEN condition
where
A selection clause specifies criteria governing which records are processed by the command. If omitted, all records are processed. The WHEN clause performs selection on exploded values from within the named multi-valued field, showing only the selected value of the named field and all associated fields
Field comparisons are performed using the internal format of field1, converting the field2 or value item to this format if required. Thus a field holding an internal date, for example, may be compared with the more natural external form of the date. For example,
LIST INVOICES WHEN ISSUE.DATE > "12 OCT 96"
will list all invoice records with an issue date after 12 October 1996.
Example
The command
LIST SALES WITH PART = 100
to find only orders containing part 100 might produce a report such as
LIST SALES WITH PART = 100 Order Part Qty 10001 100 4 107 3 219 3 10021 100 3 206 3 219 7 10014 105 3 100 1 210 7
3 records listed.
For the same data, use of the WHEN keyword to select only part 100 with a query such as
LIST SALES WHEN PART = 100
would produce the report below.
LIST SALES WHEN PART = 100 Order Part Qty 10001 100 4 10021 100 3 10014 100 1
3 records listed. |