Adding Calculated Fields

Queries give you the freedom to both retrieve records and manipulate them. Notably, you can add fields that display the results of a calculation on stored values.

Using an Arithmetic Expression

For example, suppose you were anticipating that purchase prices would rise uniformly for all products about 8%. You want to create a field that will show what the new prices will be for each product.

You've used expressions to set criteria; now you'll use one to create a calculated field.

1.
Select the tblMerchandise table in the Database window. Choose Insert, Query. With Design View selected, click OK.
2.
Add MerchName, MerchDescription, and PurchasePrice to the design grid.
3.
Click in the Field row of the fourth column.
4.

Get Hands-On Microsoft Access: A Practical Guide to Improving Your Access Skills now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.