Access includes a number of built-in date functions that you can use in expressions to work with dates. This video shows you how to use the Expression Builder to get started with date functions, and how to get more information about the functions.
In the video
In this video, we use the Expression Builder to research date functions and then add one to a report.
Note Not all functions are available in every context. The Expression Builder will only show you the functions that are appropriate for each one.
To use a function, you must first be in a context that accepts expressions. Some examples of these include:
- Certain properties of properties, forms, and reports (for example, the Control Source property of a control)
- The Criteria row of the Query Design grid
- Certain arguments of macro actions
- A calculated field in a table
- A data validation rule
- The Group, Sort, and Total pane in Report Layout View
Use the expression builder to add a date function to a report
In this video, we enter a date function as an expression in the Control Source property of a control on a report, by using this procedure:
- Open the report in Layout View by right-clicking it in the Navigation Pane, and then clicking Layout View.
- Select the control, and then on the Design tab, in the Tools group, click Property Sheet.
- Click in the Control Source property box, and then click the Build button .
In other contexts, you can open the Expression Builder by clicking the Build or Builder button , or by clicking the word expression in a list. In some cases, Access will open the Expression Builder automatically, for example, when you are adding a validation rule or a calculated field in a table.
- In the Expression Builder, click More >>.
- In the Expression Elements list, expand the Functions tree.
- Click Built-In Functions, and then in the Expression Categories list, click Date/Time.
The right-hand list changes to show me the available Date/Time functions.
- In the Expression Values list, click on a function to view a short description of the function at the bottom of the expression builder. Click the link to view a Help article for the function.
- When you find the function you want to use, double-click it function to add it to the expression box.
- Replace the placeholder values with valid arguments. The placeholders are indicated by angle brackets, for example, <<number>>.
- When finished editing, click OK in the Expression Builder.
Access adds the expression to the Control Source property box.
- Test the function by switching to Report view: on the Home tab, in the Views group, click View, and then click Report View.