Hi,
AVG works vertically, not horizontally; it works across records, not across
fields.
AVG can support expression, such as AVG(10*x) which would be the same as
10*AVG(x), here, but less trivial can be something like AVG(x*x) which
would average the square of the values in the field x.
In your initial first case, you were building an expression of three actual
fields, x1+x2+x3 (if one is null, the result is also null) and once that
sum was made, AVG was working vertically, through all the record, making the
same sum for each records, first.
Hoping it may help,
Vanderghast, Access MVP
Mairtin said:
Yip have tried that and it works!!! when reading the help file I thought I
could use teh AVG function. What I am trying to do is average values in
one
record in an additional column in the query. I gather from the replies
that
the avg function doesnt work in this case!!!
David F Cox said:
If it is the case that it is three fields within each record then it is
([test1]+[test2]+[test3]}/3
Klatuu said:
The avg function can only be used in a Totals Query. You should be
averaging
based on some other field, I would guess
SELECT SomeField, Avg([test1]+[test2]+[test3]) AS YrAvg
FROM SomeTable
GROUP BY SomeField;
:
I am running a query with the following function
=avg([test1]+[test2]+test3])
I get an error message to say that the test1 expression is not part of
the
aggregrate function. The field name is definately test1, if I omit
test1
i
get the same message refering to test2 - Help Plz