Jump to content

HELP - MySQL NOT EXIST -Trouble


closerwalk

Recommended Posts

Here it goes... What I am trying to do is in our time tracking database I want to be able to print out a report that shows the missing time cards for the day.  I am not certain how to get there it sounds earier than its been.  Here is what I have been trying unscucessfully at.  Below is a NOT EXIST sub query, which I am sure probably is not correct.  What I need to do is query the Employee database against the timesheet table for the current date and output employees from the employee database which have no records for the day in the time database.

 

SELECT EMPLOYEE_NO FROM employee
  WHERE NOT EXISTS (SELECT DISTINCT EMPLOYEE_NO FROM time
WHERE time.EMPLOYEE_NO = employee.EMPLOYEE_NO AND time.date='2007-05-24')

 

Anyone who can offer suggestions or a fix I would be appreciated.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/55633-help-mysql-not-exist-trouble/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.