How do I find the maximun values in each group?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a set of data that has a number of resluts for differnet things.
Easiest described as a number of classes, each with a number of students, sit
exams. Each of the students from every class recieve a result. I want to be
able to find the maximum result for each class, using a query.
 
michelle said:
I have a set of data that has a number of resluts for differnet things.
Easiest described as a number of classes, each with a number of students, sit
exams. Each of the students from every class recieve a result. I want to be
able to find the maximum result for each class, using a query.

It's going to look something like:

SELECT class, Max(result) FROM results GROUP BY class
 
it's been a while since I have used Access queries. I cant get this to work
no matter how I word it. Exactly how would this need to be worded if my
table headers are "class", "student" and "result" and which column/field does
it need to go in?
 
michelle said:
it's been a while since I have used Access queries. I cant get this to work
no matter how I word it. Exactly how would this need to be worded if my
table headers are "class", "student" and "result" and which column/field does
it need to go in?

If the field names are as you describe, then the query is exactly as I gave
you before, namely:

SELECT class, Max(result) FROM results GROUP BY class

It doesn't go into any column/field. Open the query designer, click the
"SQL" button on the toolbar, and paste it into the window that opens. Run
the query by clicking the "!" button.
 
Back
Top