Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 4: Selecting Data with Queries


149


FIGURE 4.19

The order of the fields in the QBE grid is critical when sorting on multiple fields.


Records showing sorting precedence


Displaying Only Selected Records


So far, most of the queries described in this chapter return all the records in the tblCustomers
and tblProducts tables. Most often users want to work only with records conforming to some
criteria. Otherwise, too many records may be returned by a query, causing serious performance
issues. For example, you might want to look only at customers who have not bought any products
within the last six months. Access makes it easy for you to specify a query’s criteria.

Understanding selection criteria
Selection criteria are filtering rules applied to data as they’re extracted from the database. Selection
criteria instruct Access which records you want to look at in the recordset. A typical criterion
might be “all sellers,” or “only those vehicles that are not trucks,” or “products with retail prices
greater than $75.”

Selection criteria limit the records returned by a query. Selection criteria aid the user by selecting
only the records a user wants to see, and ignoring all the others.
Free download pdf