The Expression Builder is a helpful tool for
building expressions in queries and in many other situations in Access.
To invoke the Expression Builder, you click the Field cell of the query
design grid and then click Build on the toolbar. The Expression Builder
appears (see Figure 1).
Notice that the Expression Builder is divided into three columns. The
left-hand column shows the objects in the database. After you select an
element in the left column, select the elements you want to paste from
the middle and right columns.
The example in Figure 2 shows Functions selected in the left column. Within Functions, both user-defined and built-in functions are listed. Here, the Functions object is expanded with Built-In Functions selected. In the center column, Date/Time is selected. After you select Date/Time,
all the built-in date and time functions appear in the right column. If
you double-click a particular function—in this case, the DatePart
function—Access places the function and its parameters in the text box
at the top of the Expression Builder window. Notice that the DatePart function has four parameters: Interval, Date, FirstWeekday, and FirstWeek.
If you know what needs to go into each of these parameters, you can
simply replace the parameter placeholders with your own values. If you
need more information, you can invoke Help on the selected function to
learn more about the required parameters. Figure 3
shows two parameters filled in: the interval and the name of the field
being evaluated. After you click OK, Access places the expression in
the Field cell of the query.