Using Selection Expressions

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 the AND and OR connectives to create a compound selection expression by:

  1. Specifying more than one selection expression for a single attribute, or

  2. 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:

Using Relational Operators

String Searching

Using the LIKE Connective

Using Logical Connectives

Selection Options

See Also

Producing Reports with LIST and SORT

Using the LIST and SORT Commands

Displaying Selected Attributes

Using SORT Expressions

Using Print Limiters

Producing Vertical Listings with LIST-ITEM