Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the average of the averages of a field

Status
Not open for further replies.

Ciarak

Programmer
Oct 17, 2001
9
GB
Hi,
Is it possible to find the average of the averages of a field ie avg(avg(field)).When I use this I get the error "Can't have average function in expression".

I have a table that holds inspection data based on specific component locations on a board.It holds this data for each inspection.I have a recordset that finds the average of each specific location across the inspections.Basically I want the average of this recordset.
 
You need to do this in 2 separate queries.... first get the average for each location and then use this in a new query to find your overall average, eg:

q1:

select location, avg(field) as loc_avg
from x
group by location

q2:

select avg(loc_avg) as overall_avg
from q1



Best Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top