Part I: Access Building Blocks
202
l (^) Customer 3 lives in NY and CA — the expression is True.
l Customer 4 lives in CT — the expression is False.
Specifying multiple values with the Or operator
The Or operator is used to specify multiple values for a field. For example, you use the Or opera-
tor if you want to see all records of buyers who live in CT or NJ or NY. To do this, follow these
steps:
- Open a new query in Design view, and add tblCustomers and tblSales.
- Add Company and State from tblCustomers and SalesDate from tblSales.
- Click in the Sort cell of State.
- Select Ascending from the drop-down list.
- Click in the Criteria cell of State.
- Type AZ Or CA Or NY in the cell.
Your QBE pane should resemble the one shown in Figure 5.10. Access automatically
places quotation marks around your example data — AZ, CA, and NY.
FIGURE 5.10
Using the Or operator. Notice the two Or operators under the State field — AZ Or CA
Or NY.
Using the Or cell of the QBE pane
Besides using the literal Or operator as a single expression on the Criteria row under the State
field, you can supply individual criteria for the field vertically on separate rows of the QBE pane, as
shown in Figure 5.11.