[email protected] Posted May 29, 2007 Share Posted May 29, 2007 i need help to build a SQL query/statement to select only records with a date from now and 1 month before and also from now and two months before? is going to be something like: select * from table where month(date_of_entry )= month(now(-2)) thanks in advance Link to comment https://forums.phpfreaks.com/topic/53405-help-with-mysql-datetime-query/ Share on other sites More sharing options...
Wildbug Posted May 29, 2007 Share Posted May 29, 2007 SELECT * FROM table WHERE date_of_entry BETWEEN NOW () - INTERVAL 2 MONTH AND NOW(); Link to comment https://forums.phpfreaks.com/topic/53405-help-with-mysql-datetime-query/#findComment-263872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.