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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help using Count and Group by :)

Status
Not open for further replies.

savok

Technical User
Jan 11, 2001
303
AT
I have 3 fields....Hospitals...Classes in Hospitals and StudentIDs

There are about 10 hospitals and about 10 diff classes in each hospital. I need to count how many students attended each class in each hospital.

I put the Hospital field on the form, and put the Classes on the form and everything is fine. The I put StudentID on the form and did Insert Summary, selected Count, then you select which field you want it counted and grouped by. If I put Hospital, it counts all students for hospitals, if i put Classes it counts all students for classes without considering the hospitals. Now is there any way I can select to group it by both hospital and class? Or am i doing this whole thing wrong all together? Please help
:) thanks
 
By both Hospital and class, do you mean a grand total for all hospitals and all classes? If so, you can move the summary field into the report footer - this will give you a total for the whole report. Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
I think that what you want to do is first group by Hospital then group by Class. To do this, go to Insert - Group and first select the Hospital field to group on. Then go through the same steps again, only group by the Class field this time. Then you can insert summaries for both of them like you did before. The summary for the Hospital Group will return the total number of students in classes at that hospital. The summary for the Class Group will return the number of students in a Class within a Hospital. That way, if the same class is held at different hospitals, it won't give you a total for all stundents in that class, just those in that class for each hospital.

I hope that helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top