Re: What does "expression" refer to in the Totals list in a Query?
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Fri, 9 Jun 2006 11:43:08 +0800
The last sentence skipped an important point:
Expressions are fields in the SELECT clause
that are not in the GROUP BY clause,
and have no aggregation (such as First or Sum or Count.)
"Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx> wrote in message
news:e6CQYX3iGHA.1936@xxxxxxxxxxxxxxxxxxxxxxx
A totals query aggregates data.
For each field, you specify how to aggregate that column's data, e.g.:
- Group By means to return each value;
- Sum means add up all values for the grouped by fields.
Expression means: don't aggregate on this field, just include a column
with this value. For example, if you type into the Field row:
Expr1: 99
and choose Expression, you get a 99 on every row of the query.
Since the expression is tacked on after aggregation, it can refer to other
fields that are in the query results. Any Group By field is in the
results, so if you group by Surname and FirstName, you can use an
expression such as:
Expr1: [FirstName] & " " & [Surname]
If you have a field called Amount that you Sum, Access will alias the
column as SumOfAmount. You can therefore refer to that in your Expression.
For example, to calculate 8% sales tax on the amount:
Expr1: [SumOfAmount] * 0.08
If you look at the SQL statement, these expressions are fields in the
SELECT clause that are not in the GROUP BY clause.
"Joshcat99" <Joshcat99@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3B3CD180-6F33-4963-9855-8E4B6BA639A7@xxxxxxxxxxxxxxxx
In the drop-down list in the Totals row in a Query grid, what does
"expression" refer to? How do you use it?
.
- Follow-Ups:
- Re: What does "expression" refer to in the Totals list in a Query?
- From: Marshall Barton
- Re: What does "expression" refer to in the Totals list in a Query?
- From: Gary Walter
- Re: What does "expression" refer to in the Totals list in a Query?
- References:
- Re: What does "expression" refer to in the Totals list in a Query?
- From: Allen Browne
- Re: What does "expression" refer to in the Totals list in a Query?
- Prev by Date: Re: What does "expression" refer to in the Totals list in a Query?
- Next by Date: Re: Pass Thru Query / Criteria
- Previous by thread: Re: What does "expression" refer to in the Totals list in a Query?
- Next by thread: Re: What does "expression" refer to in the Totals list in a Query?
- Index(es):
Relevant Pages
|