If I understand you correctly, I think you want rows with date_2 not greater than or equal to date_1 plus some number of days, say 30. Then date_2 needs to be less than date_1 plus 30 days. So, you would use something like:

  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]



Reply via email to