Query Problem

SDBonner

New Member
Joined
Dec 23, 2009
Messages
28
Hiya,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
I’m pretty new to Access so my knowledge is still pretty limited – so be gentle!
<o:p> </o:p>
I have query that pulls out training course attendees in the following way:
<o:p> </o:p>
Person A Course A Module 1 Attended
Person A Course A Module 2 Attended
Person A Course A Module 3 Not Attended
<o:p> </o:p>
Person B Course A Module 1 Not Attended
Person B Course A Module 2 Not Attended
Person B Course A Module 3 Not Attended
<o:p> </o:p>
I can get the results for either Attended or Not Attended – for this example; if I pull the Not Attended I get the results for person A and B. I only want person B (i.e. those people who did not attend any modules at all.
<o:p> </o:p>
Am I making this horrendously complicated?!
<o:p> </o:p>
Thanks in advance for all help….
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Can you show us the tables and relationships of your database?

Often you would have 3 tables (more depending on your situation).

Students (studentID PK, other student specific info)

Courses(CourseID PK, other course specific info)

And a Junction Table
StudentCourse (identifying Student Took this Course)


You could use a query such as
Code:
SELECT Student.id, Student.studentName, SelectedCourses.CourseId
FROM SelectedCourses RIGHT JOIN Student ON SelectedCourses.StudentId = Student.id
WHERE (((SelectedCourses.CourseId) Is Null));

to identify Students with No Courses.
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,544
Members
452,925
Latest member
duyvmex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top