I have a query that sorts data from a table based on a build type. Each build type has several designs, and each design has several bars associated with it. For each bar there is 42 to 64 different parts, and each part has data from 8 different electrical tests performed on it. How do you average the electrical test data so that my query comes out as a column for BAR#, DESIGN#, and a column for each electrical test that has the average for that test on that bar?
How do you average in a query?
Collapse
X
-
Average in Query
In query design view right click in a field and select Totals. A new row will appear with group by in each column. Select the column you want to average then change the group by via the drop down to Average. Save and run the query. -
The SQL for your query would be similar to :
This doesn't mean Paul's answer is wrong by the way, it is simply saying the same thing but from a different perspective.Code:SELECT [BAR#], [DESIGN#], Avg([Test1]) AS Test1Avg, Avg([Test2]) AS Test2Avg, Avg([Testn]) AS TestnAvg FROM [YourTable] GROUP BY [BAR#], [DESIGN#]Comment
Comment