Grouping by individual fields when there are multiple linked records


#1

Hello! I’m running a database for my private education business. A single child can be enrolled for multiple classes (detailed in a field called “Classes Enrolled into”, and I want to be able to see each individual class when I group it by this field.

Eg.
If Student X is enrolled in Grade 1 Math and Grade 1 Science, and Student Y is enrolled in just Grade 1 Math, I wish to see this when I group:

Grade 1 Math
Student X
Student Y

Grade 1 Science
Student X;

and not:
Grade 1 Math, Grade 1 Science
Student X

Grade 1 Math
Student Y

Any ideas?

Appreciate your help guys! :slight_smile:


#2

Sounds like you need a join, junction or linking table between the Students table and Classes table. You could call the join table “Enrollments” and group the enrollment records by class.