Microsoft Office Tutorials and References

In Depth Information

Using Compound Criteria

Often you will have more than one criterion that the data for which you are searching

must satisfy. This type of criterion is called a
compound criterion
. Two types of compound

criteria exist.

In an
AND criterion
, each individual criterion must be true in order for the

compound criterion to be true. For example, an AND criterion would allow you to ﬁ nd those

clients that have an amount paid greater than $20,000.00 and whose recruiter is recruiter 21.

Conversely, an
OR criterion
is true provided either individual criterion is true. An

OR criterion would allow you to ﬁ nd those clients that have an amount paid greater than

$20,000.00 or whose recruiter is recruiter 21. In this case, any client whose amount paid

is greater than $20,000.00 would be included in the answer, regardless of whether the

client’s recruiter is recruiter 21. Likewise, any client whose recruiter is recruiter 21 would

be included, regardless of whether the client had an amount paid greater than $20,000.00.

The BETWEEN

Operator

The BETWEEN operator

allows you to search

for a range of values in

one ﬁ eld. For example,

to ﬁ nd all clients whose

amount paid is between

$10,000 and $20,000, you

would enter Between

10000 and 20000 in

the Criteria row for the

Amount Paid ﬁ eld.

To Use a Compound Criterion Involving AND

To combine criteria with AND, place the criteria on the same line. The following steps use an AND criterion

to ﬁ nd those clients whose amount paid is greater than $20,000.00 and whose recruiter is recruiter 21.

1

•
Return to Design view.

•
Include the Recruiter Number ﬁ eld

in the query.

View

button

•
Type
21
as the criterion for

the Recruiter Number ﬁ eld

(Figure 2–30).

Recruiter Number

ﬁ eld added

criterion for

Recruiter

Number ﬁ eld

criterion for

Amount Paid ﬁ eld

because criteria are

in the same row,

both must be true

Figure 2–30

•
View the query results

(Figure 2–31).

only clients whose

amount paid is

more than $20,000

and whose recruiter

number is 21 are

included

View

button

query

results

Figure 2–31