Microsoft Office Tutorials and References
In Depth Information
Session 3.2
be met in order for a record to be included in the query results. However, if you place con-
ditions in different Criteria rows, a record will be selected if at least one of the conditions is
met. If none of the conditions is met, Access does not select the record. When you place
conditions in different Criteria rows, you are using the Or logical operator . Figure 3-26 illus-
trates the difference between the And and Or logical operators.
Figure 3-26
Logical operators And and Or for multiple selection criteria
design grid using the And logical operator
Are both
conditions
satisfied?
condition
condition
Criteria:
YES
NO
or:
select
record
do not
select record
conditions are placed in the same row
design grid using the Or logical operator
Are one or
more conditions
satisfied?
condition
Criteria:
YES
NO
condition
or:
select
record
do not
select record
conditions are placed in different rows
The And Logical Operator
To create Elsa’s query, you need to modify the existing July1Positions query to show only
the records for employers located in Prince Edward Island and offering positions starting
on 07/01/2006. For the modified query, you must add a second condition in the same
Criteria row. The existing condition for the StartDate field finds records for positions that
start on July 1, 2006; the new condition “PE” in the StateProv field will find records for
employers in Prince Edward Island. Because the conditions appear in the same Criteria
row, the query will select records only if both conditions are met.
After modifying the query, you’ll save it and then rename it as “PEJuly1Positions,” over-
writing the July1Positions query, which Matt no longer needs.
To modify the July1Positions query and use the And logical operator:
1. With the Queries object selected in the Database window, click July1Positions (if neces-
sary), and then click the Design button to open the query in Design view.
2. Scroll the design grid to the right, click the StateProv Criteria text box, type PE , and then
press the
key. See Figure 3-27.
 
Search JabSto ::




Custom Search