I have three tables that I am using to track who attends meetings on a particular date:
Code:
people - person_ID, lname, fname
date - date_id, date
attendance - attendance_ID, person_ID, date_ID
Since the meetings are held once I week at the same location, I only need to track the date of the meeting. But my problem is I need to show who was NOT present at the meeting on a particular date. I am using the following query since I am using MySQL Version 4.0.25-standard. Evidentially, I have to have version 4.1 to use the NOT IN query.
Code:
SELECT people.* FROM people LEFT JOIN attendance ON people.person_ID=attendance.person_ID WHERE attendance.date_ID IS NULL ORDER BY people.lname, people.fname;
My problem is I need to find out who did not show up for a particular date. The query I have above shows everybody in the database who has never shown up for any meeting. I can't figure out what I'm doing wrong. Any suggestions? Any help is appreciate. And thanks in advance.
|