A selection expression specifies the conditions that an item must meet to be included in a report. Selection expressions test the data in one or more attributes by comparing it against the specified criteria.
Format
WITH [EVERY | EACH] [attribute-name] [rel-op] value-list [[AND | OR] [attribute-name] [rel-op] value-list] ... |
Parameter(s)
EVERY or EACH |
Specifies that all values in a MultiValued attribute must meet the specified condition if the item is to be listed. |
attribute-name |
Attribute whose data is compared to the specified criteria. If no attribute is specified, INFO/ACCESS compares the item-ID to the specified criteria. |
rel-op |
Relational operator such as Less Than (<). For a complete list of valid relational operators, see the topic "Using Relational Operators" in this section. |
value-list |
One or more constants, enclosed in double quotes. |
Description
Selection criteria are specified as follows:
Use relational operators (such as Less Than <) to compare the data in an attribute to a constant.
Use pattern matching to specify a character string that must appear at the beginning, middle, or end of an attribute’s data.
Use the LIKE connective to find data that sounds similar to a constant.
Use the AND and OR connectives to create a compound selection expression by:
Specifying more than one selection expression for a single attribute, or
Defining one or more selection expressions for additional attributes
For example, this query displays the item-IDs of customers (items) from the CUSTOMERS file whose last name is Andrews:
>LIST CUSTOMERS WITH LAST-NAME "ANDREWS" |
The next query lists customers whose last name is Andrews and who live in the city of Newton:
>LIST CUSTOMERS WITH LAST-NAME "ANDREWS" AND WITH CITY "NEWTON" |
The following sections contain detailed information about forming selection expressions.
The following topics are also presented in this section:
See Also
Producing Reports with LIST and SORT
Using the LIST and SORT Commands