February 15th, 2012, 01:26 AM
Get Time defaulters list
Following are the table details
Everyday employees enter their time entries and their task details. I want to have list of employees that did not fill their time entries between a given date range.
If the date range is more than one day and the employee has not entered time details for more than one day in between the range, then the employee name should appear more than once with respect to date.
date | employee_id | employee_name
February 15th, 2012, 12:07 PM
If the time_tbl will always have a record for each day then try this.
FROM employee_tbl e
LEFT JOIN time_tbl t on e.employee_id = t.employee_id
WHERE time_date between @startdate and @enddate
AND (time_start is null or time_end is null)