|Command||access.selection.criteria Definition/Access: Verbs
Applicable release versions: AP, R83
|Category||Access: Verbs (152)|
|Description||determines which items are to be processed by Access and is designated by the "with" or "if" modifiers.
Without any "selection clauses" in an Access sentence, every item in the file is eligible for processing.
Compound selection clauses are formed with the "and" or "or" relational operators. When two clauses are connected by an "and", both conditions must evaluate to "true" for an item to be selected for processing. When two selection clauses are connected with an "or", or no relational operator is specified between selection clauses, either condition may evaluate to true for the item to be selected for processing.
The value specified in the "valuestring" clause must match exactly with the stored value for selection to occur. For example, in the sentence:
list entity with city = "irv" city
Only those items which contain "irv" in the "city" attribute are eligible for processing.
Access permits the use of "string searching" (sometimes called "wild cards") which allow introducing variables into the selection criteria. For example, in the sentence:
list entity with city = "irv]" city
The "]" character specifies that any character(s) may follow the literal string, "irv". This means that both "irvine" and "irving" are selected. In the sentence:
list entity with name "[inc."
Any item whose "name" attribute ended with "inc." is eligible for processing.
The "bracket" ("string searching") characters may also state an "including" or "containing" condition, as in the form:
list entity with name = "[pick]"
Which includes in the report any item whose "name" attribute contains the string "pick". This includes "Pick Systems", "Movenpick Restauraunts" and "The First Pick".
list entity with name "ar]" name In this selection criteria, only those items whose "name" field begins with "ar" are selected. list entity with name "mi]" and with phone "804]" This example shows two selection clauses connected with an "and", which means that both conditions must be evaluated as true in order for the items to be selected for processing. list entity with name "re]" or with city "irv]" name city This example shows a mutually exclusive set of selection crtieria connected with an "or". Either condition evaluating to true will accept the item for processing. That is, if the "name" attribute begins with "ar", or the "city" attribute begins with "irv", the item will be selected for output. list entity with name "ar]" and with city "irv]" or with city "san]" and with contact "[joe]" There is virtually no limit to compound selection criteria in an Access sentence, with the exception of the fact that Access limits a sentence to a maximum of 9 "and" clauses.