Fix Calculated Query Aliases Used as Criteria in Microsoft Access
Question details
Use a calculated query expression as a filter without Access treating its alias as a parameter.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A query calculates a value and needs to filter on it, potentially as part of selecting a rate based on day and time.
- Observed behavior
- Access may prompt for an alias such as Expr3 when it is referenced in criteria within the same query.
Open the query in Access and identify the full expression behind the alias, along with the field and table names it uses. If the query references a form control, verify that the form is open and that the control name is correct.
Repeat the calculation in the query criteria
Use the original expression instead of its alias when filtering within the same query.
In the Navigation Pane, right-click the query and select Design View. Find the calculated field, such as Expr3: DateDiff("n", [Start Time Booked], [Finish Time Booked]).
In an empty Field cell, enter DateDiff("n", [Start Time Booked], [Finish Time Booked]). In that column's Criteria cell, enter >60, and clear Show if you do not need a second displayed calculation.
Select Run on the Query Design ribbon. Replace the example expression and threshold with the calculation and condition needed for your query.

Filter the calculated field in a nested or saved query
Use a second query when the calculation is complex or you want to reuse its alias.
Use a rate table to look up day and time intervals
Use a dedicated rate table when the calculation depends on weekdays, time ranges, and rate values.
Work with Rate Worksheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with office files. Open compatible spreadsheets and documents to make migration easier; Access databases and queries still require a compatible database application.

Frequently Asked Questions
Why does Access ask me to enter a value for Expr3?
Access may not recognize a calculated alias in criteria at the same query level and may treat it as a parameter. Repeat the underlying expression or filter Expr3 in an outer query. Also check for misspelled field and control names.
How do I filter a calculated field without repeating a long expression?
Save the calculation as a query, then select Create > Query Design and add that saved query as the source. Add the calculated field to the grid and enter its condition in the Criteria row.
How should I compare a booking time with a rate interval?
Use separate comparisons joined by And, such as booking time >= start time And booking time < end time. An interval that crosses midnight requires special handling because its end time is earlier than its start time.
What if a booking crosses a rate change?
A single rate lookup may not calculate the correct total. Split the booking at each rate boundary, calculate the charge for each interval, and sum the results. Include date changes when selecting the applicable weekday rate.




