SQL-query everything from last month
Posted: Fri Feb 26, 2016 12:49 pm
Hi,
How do I make a query to get everything from 1 month ago until now?
thanks.
How do I make a query to get everything from 1 month ago until now?
thanks.
Forum of Webmaster2020.com
https://webmaster2020.com/forum/
Code: Select all
SELECT * FROM table WHERE datefield > DATE_SUB(NOW(), INTERVAL 1 MONTH);
Code: Select all
SELECT * FROM table WHERE datefield > DATEADD(m, -1, GETDATE());