| Lesson 10 | Using Totals queries |
| Objective | Work with a Totals query to present group totals. |
A standard SELECT query is ideal when you want to see every matching record in detail.
However, many reporting tasks require summarized information instead:
In Microsoft Access 365, you use a Totals query to transform a regular Select query into a grouped summary. A Totals query lets you group records (for example, by project or customer) and then apply aggregate functions such as Sum, Count, or Avg to produce group totals.
You begin by creating a normal Select query in Design View. After you choose the fields you want, you convert the query into a Totals query using the Totals button (Σ) on the Ribbon.
When you enable Totals, Access adds a new row to the query grid called the Total row. For each field in your query, you choose whether the field:
The following table summarizes the aggregate options available in Totals queries.
| Function | Description |
| Sum | Adds all values in the field. |
| Avg | Returns the average (mean) value. |
| Min | Returns the smallest value. |
| Max | Returns the largest value. |
| Count | Counts the records in each group (or non-null values in a field). |
| StDev | Calculates the sample standard deviation. |
| Var | Calculates the sample variance. |
| First | Returns the first value in the group (based on the underlying sort order). |
| Last | Returns the last value in the group. |
| Expression | Uses a calculated expression (for example, multiplying or combining fields). |
| Where | Uses the field only for criteria; the field does not appear in the result set. |
The following steps show how to build a Totals query in Microsoft Access 365 using Query Design view. The example assumes a table that tracks hours worked per project.
ProjectName (or ProjectID)HoursWorkedWorkDate (optional, for date filters)ProjectName (or ProjectID), choose Group By.HoursWorked, choose Sum to total hours per project.WorkDate column and use
the Criteria row with a condition such as:>= #1/1/2024# AND <= #12/31/2024#
Example output – Totals query for a sales table:
SalesData contains:
Category – product categorySaleAmount – revenue per saleSaleDate – date of saleA Totals query with Category set to Group By and SaleAmount set to Sum could produce:
| Category | Sum of SaleAmount |
|---|---|
| Electronics | $15,000 |
| Furniture | $8,500 |
SELECT query that shows ProjectName and
HoursWorked for each time entry.
Click the Totals (Σ) button to convert it into a Totals query.
ProjectName is set to Group By.HoursWorked from Group By to Sum.This pattern—Group By for categories, Sum/Count/Avg for numeric measures, and Where for criteria-only fields—is a best practice when designing Totals queries in Access 365.
The Datasheet Totals row respects any filters you apply. If you filter a table down to five rows, only those five rows are used in the calculation. This makes it a convenient tool for quick “what-if” checks, while saved Totals queries remain the best option for reusable reports and forms.
In the next lesson, you will learn what Crosstab queries are and how to create them.