How do I count non-duplicated records in a query in Access?

J

Joshcat99

From the database of all students, I want to count the number of students who
have attended classes in any of the last 4 terms, without duplications (some
students have attended more than one term.

My query includes student ID# - Active Attendance - 2005 OR 2006 - Summer OR
Fall Or Winter Or Spring.

Can I use an aggregate function - Count or DCount? What field do I count,
and do I turn on the Group By for the other fields?
 
J

John Spencer

No table structure, no field names. So here is a generic response.

SELECT Count(*)
FROM (SELECT Distinct StudentID
FROM tableStudents
WHERE StudentID in
(SELECT Classes.StudentID
FROM Classes
WHERE ActiveAttendance in (2005, 2006))) as DistinctID
 

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

Top