Examples of using aggregate functions in forms and reports

Examples of using aggregate functions in forms and reports

The following table lists examples of expressions you can use in calculated controls on forms and reports.

Expression Description
=Avg([Freight]) Uses the Avg function to display the average of the values of the Freight control.
=Count([OrderID]) Uses the Count function to display the number of records in the OrderID control.
=Sum([Sales]) Uses the Sum function to display the sum of the values of the Sales control.
=Sum([Quantity]*[Price]) Uses the Sum function to display the sum of the product of the values of the Quantity and Price controls.
=[Sales]/Sum([Sales])*100 Displays the percentage of sales, determined by dividing the value of the Sales control by the sum of all the values of the Sales control.

Note   If the control's Format property is set to Percent, don't include the *100.


Notes