0
I need to show in a query some items between the current date of the time in question and two years before.
0
I need to show in a query some items between the current date of the time in question and two years before.
3
Use the BETWEEN
with date_sub
to subtract an interval from the date reported:
SELECT * FROM table WHERE data BETWEEN NOW() AND DATE_SUB(NOW(), INTERVAL 2 YEAR);
Browser other questions tagged mysql sql query
You are not signed in. Login or sign up in order to post.