user table contains users' information. The
clock_in table contains the clockin of the users every day. I have been trying to check who is absent or not yet clocked in.
For example by 9:00 am, I should be able to check who has not clocked in yet. I have came up with the MySQL query and this what I have come up with so far after about 7 days now searching. The idea is to compare the user table to the users clockin today, if there is an unmatched (IS NULL) then that user has not clocked in today. Here is my updated query so far.
SELECT users.* FROM users LEFT OUTER JOIN timecard ON users.id = timecard.employment_id AND timecard.date='".$today."' WHERE timecard.employment_id IS NULL and user.location = '".$location."' ORDER BY users.dept DESC
Please, I know Left Outer Join may be the right one according to the results of my search, need your advice