Chapter 18: Advanced Access Query Techniques
647
l (^) If the field has criteria specified, Access moves it to the rightmost columns in the QBE
pane.
l (^) Access may eliminate the field from the QBE pane unless it has sorting directives or criteria.
l If you create an expression using the Sum operator, Access changes it to an expression
using the Sum function. This means that, from time to time, a query’s appearance in the
Query Designer changes as Access finds a more optimal way of performing the same oper-
ation you specified in the query’s initial design.
Because of these rules, your query may look somewhat different after you save and reopen it. In
this section, you learn how this happens (and some ways to prevent it).
Hiding (not showing) fields
Now and then, you may need to use a particular field as part of a query’s criteria or for sorting pur-
poses, but the field’s values aren’t needed in the query results. For instance, you might need a
query for a report showing all the sales in the last 90 days, but you don’t need the sales dates in the
reports. Furthermore, you may want the sales by category, but don’t need to see the actual category
names in the report.
To hide, or exclude, a field from the query results, deselect the Show box under the field you want
to hide. Figure 18.11 demonstrates this process. Notice that the State field is used to specify CT,
NY, or MA. Because you don’t need this field in the query results, deselect Show for the State field.
FIGURE 18.11
The easiest way to hide a field is to deselect the field’s Show check box.
Criteria
Show box is
unchecked
Renaming fields in queries
When working with queries, you can provide an alias for a field to describe the field’s contents
more clearly or accurately than the field’s name in the underlying table. This new name is shown