Where to specify criteria to affect when calculations are performed
In the query design grid, where you specify criteria determines when the calculation is performed.
Note Although the following examples only show queries that calculate totals, these guidelines apply to calculated fields as well.
- To limit groupings before you perform calculations on groups of records, specify the criteria in the Group By fields.
- To return only selected results after the calculation is performed, specify criteria in the field that contains the calculation. This rule applies whether you're performing the calculation on each record, groups of records, or all records.
- To limit the records before they are grouped and before the calculation is performed, add to the design grid the field whose records you want to limit, and then specify criteria in the field's Criteria cell. If you're calculating totals in the same query, set the Total cell for the field containing the criteria to Where. This rule applies whether you're calculating the total on all records or groups of records. (Microsoft Access automatically clears the Show check box.)
The following example uses the ExtendedPrice field twice, once to limit the records and once to calculate the total. However, you can use a different field to limit records by dragging that field to the design grid and setting its Total cell to Where.
Note For examples of criteria expressions, click .