I have a time off form that i use and i have an absentee list that users can go to and browse to see who is off. I created a query that pulls all the records by the first date there gone. Below is what my query looks like. It will pull everyone that is off for the next 7 days. The issue I have is I have another field that is there return date. Right now if a user is gone lets say August 15th and there return date is August 20th my query wont list them after the 15th. What do i need to add to list these users? Thanks
SELECT id, fullname, department, firstdate, returndate, comment from timeofflog
firstdate BETWEEN DATE_ADD(NOW(), INTERVAL -1 DAY) AND DATE_ADD(NOW(), INTERVAL 6 DAY)
and status = 'Approved'
order by department, fullname