I have a simple PHP web app for daily attendance of empployee
I have a table named emp_master
it would have all the employee data
for example
emp_id emp_name
1001 Abby
1002 Buub
And another table named timesheet_tran
with dailt transaction when even employee log into the system
timesheet_tran table
date emp_id
02/01/14 1001
02/01/14 1002
03/01/14 1001
04/01/14 1001
04/01/14 1002
I was trying to figure out a single query to return data , between date range which would display all the employees who have logged / not logged for that day between the date range.
i need to display
emp_id date absent/present
1001 02/01/14 present
1002 02/01/14 present
1001 03/01/14 present
1002 03/01/14 absent
i tried
SELECT m.emp_id,t.date FROM timesheet_tran as t RIGHT OUTER JOIN emp_master m ON t.date BETWEEN '02/01/14' AND '04/01/14' AND t.emp_id = m.emp_id
but I need records for each date mentioned.