SELECT * FROM events WHERE `date`
BETWEEN NOW() AND DATE_ADD
(NOW(), INTERVAL 10 DAY) order by date
I am using the above code to extract the events data of ten days of interval. Now I want to Extract out all the data before this 10 days of interval and after 10 days of interval. How can I do that in a perfect way?
Please help. Advance thanks for your time
Best Answer
It is probably best to issue two queries.
You could get both at once, but it could be inconvenient if you need to separate them:
If you want to base on midnight instead of the current second, use
CURDATE()
instead ofNOW()
.