Suppose we want to list Celko’s books on SQL. In this case there are two criteria a book must meet:
- criteria 1: the author’s name must end with “Celko”
- criteria 2: “SQL” must appear in the title.
Criteria 1 must be true and criteria 2 must be true – we say the two criteria are anded. When using QBE we must place these two criteria on the same criteria line in order that MS Access finds rows that match both criteria.
In this example we are looking for titles that have the text SQL anywhere within the title. MS Access provides a way for us to define such a pattern. The character * when used in a text string is a wildcard character that matches any number (zero or more) of characters. For criteria 1 we need two wildcards and so we specify the pattern that title must match: Like “*SQL*”.
For criteria 2 we specify the pattern that author must match: Like “*Celko”.