In many Access applications you need values that are derived from existing data—for example, sales commission, line totals, or full names. Instead of calculating these values manually or exporting to Excel, you can add a
calculated field to a query so that the result is computed every time the query runs.
In Microsoft Access 365, a calculated field in a query is created by typing an
expression (sometimes called a formula) into the
Field row of an empty column in
Query Design View. The calculated field:
- Is given a name (an alias) followed by a colon.
- Uses existing fields, constants, and functions on the right-hand side of the expression.
- Can be reused as the record source for other queries, forms, and reports.
This lesson walks through adding a calculated “Commission” field to a sales query and then introduces best practices for working with expressions and Access’s special characters.
When building expressions for calculated fields, Access must be able to recognize each value as text, date/time, number, or field name. This is done using
special characters:
| Special Characters |
| This type of data |
Looks like this in an expression |
| Text |
"Seattle" |
| Date |
#1/1/2025# |
| Time |
#1:00 AM# |
| Number |
10 |
| Field Name |
[Price] |
Examples:
Commission: [Price] * 0.10 – numeric multiplier, no quotes.
FullName: [LastName] & ", " & [FirstName] – text concatenation using field names.
RecentSales: IIf([DateOfSale] >= #1/1/2025#, "Recent","Older") – date in # signs.
In Access 2010 and later (including Access 365), you can also define a
calculated field in a table. The expression is stored with the table, and the result is automatically maintained as other fields change.
Guidelines:
- Use query-level calculated fields for most reporting and analysis—values are always up to date when the query runs.
- Consider table-level calculated fields for relatively stable expressions such as a full name (First + Last) or a precomputed display value. These can be indexed and may improve performance for repeated filtering and sorting.
- Be cautious about storing calculated values that duplicate other data (denormalization); use it only when you clearly understand the trade-offs.