Microsoft Access 2010 Bible

(Rick Simeone) #1

Part III: More-Advanced Access Techniques


642


FIGURE 18.5
A query creating the DueDate calculated field.

Clicking on the View button shows the query results containing the new calculated field. (This
query is saved as qryCalculatedDueDate in the Chapter18.accdb sample database.)

Of course, you could have manually entered the DateAdd expression, but the Expression Builder
is a valuable tool when you’re creating complex, hard-to-remember expressions. The Expression
Builder always shows all the parameters required by built-in functions and provides a nice tree
view of available functions.

Counting Records in a Table or Query


The Count() function returns the number of records in a query’s results. For example, to deter-
mine the total number of records in tblCustomers, follow these steps:


  1. Start a new query using tblCustomers.

  2. Click the first empty Field cell in the QBE pane.

  3. Enter Count(*) in the cell.


Access adds a default field name (Expr1). Your query’s QBE pane should now look like
Figure 18.6.

Free download pdf