I have a table (attendance) which stores attendance data for employees.Every day , the admin logs in into his system , selects the date(on that date) and marks an employee as present or absent for that date . These records are stored in the attendance table .
I want to retrieve all records for a particular
present / absent
1.EmpId - numeric
I have tried this query and it works perfect :
select * from attendance where emp_id=1 and year(date)=year(curdate()) and month(date)=month(curdate()) and status='present';