Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 5: Using Operators and Expressions in Access


197


After creating this query, click on the Datasheet View command to view the query’s results. It
should look like Figure 5.7.

FIGURE 5.7

The results of using the Like operator with a select query in a Memo field. The query looks for the word
red in the Features field.


Clicking on the Datasheet View command on the ribbon, you see that a number of records match
your query’s criteria. The recordset returned by this query includes redundant information in the
Company and Notes columns, but the redundancy is the result of asking for this information along
with the sales and product data.

Access automatically adds the Like operator and quotation marks if you meet these conditions:

l (^) Your expression contains no spaces.
l You use only the wildcards ?, *, and #.
l (^) You use brackets ([ ]) inside quotation marks (“ “).
If you use the brackets without quotation marks, you must supply the Like operator and the quo-
tation marks.
Using the Like operator with wildcards is the best way to perform pattern searches through
memo fields. It’s just as useful in text and date fields as the examples in Table 5.6 demonstrate.

Free download pdf