views:

246

answers:

1

I'm creating a time off requester for my business and I think I've run into a small issue.

Goal: I want to display a page that will show me if anyone has request the current day off.

Problem: I have the date_from and date_to fields which contain the information of the start and end dates for each request off. However, and I apologize if I'm just over thinking (under thinking?) the solution, but I cannot for the life of me figure out how to compare if today's current date (yyyy-mm-dd) intersects with any of the current records in my database. I've tried toying around with the between query but haven't had much luck.

Any assistance would be greatly appreciated!

+3  A: 
SELECT * FROM TheTable
WHERE CURDATE() BETWEEN date_from AND date_to
Alex Martelli
Thank you much. so close! Now it all seems clear! Thanks again!
stogdilla
Alex Martelli
This seems to work just great. Currently I don't need to do anything with times just dates so thankfully this is a quick and easy solution!
stogdilla