SELECT * FROM yourtable WHERE date_2 < date_1 + INTERVAL 30 DAY;
The date and time functions are explained in the manual <http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html>.
Michael
Lee Denny wrote:
Hello,
I need to perform a select that compares two dates
I need to return all records that haven't had date_2 set after a given number of days since date_1.
I'm sure this can be done in one query but I just can't get my head around this one.
Can anyone help?
Cheers,
Lee
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]