Database Reference
In-Depth Information
The query results appear in Figure 2-16.
44
Computed
field
Parentheses
indicate negative
numbers
FIGURE 2-16
Query results
), multiplication (*),
or division ( / ). You can include parentheses in your expressions to indicate which computations Access
should perform first.
You are not restricted to subtraction in computations. You can also use addition (
รพ
FUNCTIONS
All products that support QBE, including Access, support the following built-in functions (called aggregate
functions in Access): Count, Sum, Avg (average), Max (largest value), Min (smallest value), StDev (standard
deviation), Var (variance), First, and Last. To use any of these functions in a query, you include them in the
Total row for the desired column in the design grid. By default, the Total row does not appear automatically
in the design grid. To display it, you click the Totals button in the Show/Hide group on the Query Tools
Design tab.
Example 8 illustrates how to use a function in a query by counting the number of customers represented
by sales rep 35.
EXAMPLE 8
How many customers does sales rep 35 represent?
To count the number of rows in the Customer table that have the value 35 in the RepNum column, you
select the Count function in the Total row for the CustomerNum column. In the RepNum column, you select
the Where operator in the Total row to indicate that there will also be a criterion. In the Criteria row for the
RepNum column, the entry 35 selects only those records for sales rep number 35, as shown in Figure 2-17.
Search WWH ::




Custom Search