How do I subtract 30 days from the current datetime in mysql?

SELECT * FROM table
WHERE exec_datetime BETWEEN DATEDIFF(NOW() - 30 days) AND NOW();

8 Answers
8

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *