Microsoft Office Tutorials and References
In Depth Information
Working with Totals, Subtotals, Averages, and Such
✦ Click the Totals button in the Show/Hide group of the Design tab on the
✦ Right-click the query grid and choose Totals from the contextual menu.
The only change you see is a new row, titled Total, in the QBE grid. The
next step is to drag any field name on which you want to perform math down
to the Field row of the grid. Optionally, you can create a calculated field
and then perform a calculation on that value.
When the field is in place, click the Total row and then choose an option
from the drop-down menu, as shown in Figure 2-16. Repeat this process for
each field on which you want to perform a calculation.
When you switch to Datasheet view to see the results of the query, don’t
be shocked if your large table, which consists of many records, is suddenly
reduced to many fewer records. No, you didn’t make an error; totals queries
work this way. The query shown in Figure 2-17 results in a datasheet that has
one record for each product sold. The SumOfQty field is created
automatically by the totals query (using the Qty field that you included in the query).
The ExtPrice field lists the net income for each product.
To see a single value — the total income for all products — delete the
ProductID field from the query design.
row in a
to pick a