Autoeng
Why me?
- Local time
- Today, 08:33
- Joined
- Aug 13, 2002
- Messages
- 1,302
I have the following SQL Union query which selects records that meet criteria set in qryR2IPDNN and calculates the average grouped by name and also provides the average for all.
If data is...
Jill - 2
Jill - 3
Jill - 6
Ann - 1
Ann - 3
I get a return from this query of...
Average - 3
Jill - 3.66
Ann - 2
What do I need to do to only return the average of all (in this example = 3)?
If data is...
Jill - 2
Jill - 3
Jill - 6
Ann - 1
Ann - 3
I get a return from this query of...
Average - 3
Jill - 3.66
Ann - 2
What do I need to do to only return the average of all (in this example = 3)?
Code:
Select Name, Avg(weekdays) As AvgDif
From qryR2IPDNN
Group By Name
UNION Select "Average" As Name, Avg(weekdays) As AvgDif
From R2IPDNN
ORDER BY Name;