You enter the expression in the Field cell in the query design grid. The fields you reference in the expression are from the tables or queries in the current query.
Expression | Description |
---|---|
Count(*) | Uses the Count function to count the number of records in the query, including records with Null (blank) fields. |
FreightPercentage: Sum([Freight])/Sum([Subtotal]) *100 | Displays in the FreightPercentage field the percentage of freight charges in each subtotal, by dividing the sum of the values in the Freight field by the sum of the values in the Subtotal field. (This example uses the Sum function.)
The Total row in the design grid must be displayed, and the Total cell for this field must be set to Expression. If the Format property of the field is set to Percent, don't include the *100. |
AverageFreight: DAvg("[Freight]", "[Orders]") | Uses the DAvg function to display in the AverageDiscount field the average discount given on all orders combined in a totals query. |
For more information on using domain aggregate functions, click .