Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 18: Advanced Access Query Techniques


641



  1. Click the parameter in the window at the top and type ā€œdā€ (a d in quota-
    tion marks).

  2. Click and replace it with 45 (see Figure 18.4).


FIGURE 18.4
The Expression Builder provides help for composing complex expressions.


  1. Click to select it.

  2. Go back to the Expression Elements window and expand Chapter18.accdb, expand
    the Tables tree, and then select tblSales by clicking it once.


Access moves the parameter into the Expression Values area.



  1. Double-click InvoiceDate in the Expression Categories area.


Access places the table and field name in the last part of the DateAdd function in the top
Expression Builder window.



  1. Click OK to close the Expression Builder.


Access returns to the QBE pane and places the expression in the cell for you.



  1. Access assigns a name for the expression, automatically naming it Expr1. Change the
    field name to DueDate by highlighting Expr1 and entering DueDate.


If you perform these steps correctly and widen the column to display the entire expres-
sion, the cell should look like Figure 18.5. The DateAdd() function adds 45 days to the
InvoiceDate in tblSales. The d signifies that you are working in days rather than
months, weeks, or years.

Free download pdf