Microsoft Office Tutorials and References
In Depth Information
Querying: The Basics
To remove a field name from the Design grid, select it and press the Delete
key or go to the (Query Tools) Design tab and click the Delete Columns
Sorting the query results
At the start of this chapter, “Sorting Records in a Database Table” explains
what sorting is. The Sort row of the Design grid — directly underneath the
Table name — contains a drop-down list. To sort the query, click the
dropdown list in a field and choose Ascending or Descending to sort the results
of a query on a particular field. To sort the results on more than one field,
make sure that the first field to be sorted appears to the left of the other
fields. Access reads the sort order from left to right.
Choosing which fields appear in query results
Although a field is part of a query and is listed in the Query grid, it isn’t
always necessary to display information from the field in the query results.
Consider the Query grid shown in Figure 4-6. The object of this query is
to get a list of customers by ZIP Code that ordered products in the year
2012. To that end, the query criteria cell in the Order Date field is Between
#1/1/2012# And #12/31/2012#. However, when the query results are
generated, listing the precise dates when the orders shipped isn’t necessary
because the object of the query is to get a list of customers by ZIP Code who
ordered products in 2012.