Totals Query Group By

N

Nile

Hello my name is Nile.

I have this table:
SID PID CLASS
where SID = student id.
where PID = parent id.
CLASS can equal 3, 4, 5, 6 and plus.

Here is an example of the table data:
001---23---3 (student 001, parent 23, in class 3)
002---23---5 (another student, same parent 23, in class 5 now)
003---20--12 (another student, a different parent, in class 12)

So I basically need to get something like below out of a query, I tried
making totals query
grouped by Parent, I just don't know how to get the Class calculation to
work.

Parent--Class3or4---Class5---Class6plus
23------1------------1---------0--------
20------0-------------0---------1--------

Thank you in Advance,
Nile (e-mail address removed)
 
M

Michel Walsh

Hi,


Try a crosstab query with the help of the wizard.

The (vertical) groups are the PID,
The (horizontal) fields to create come from CLASS
The result is the COUNT of SID.


That is it. You should get the result you are looking for.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top