on 01/28/2004 12:03 AM, Duncan Hill at duncanh@stripped wrote:
> On Wednesday 28 January 2004 06:00, Scott Haneda wrote:
>> I have done this so many times..
>> SELECT * FROM `support_start` WHERE TO_DAYS(NOW()) - TO_DAYS(date) > 7
>>
>> I have scoured (more like glanced :-)) at the docs on
>> <http://www.mysql.com/doc/en/Date_and_time_functions.html> and can not
> seem
>> to find how to get all records where a timestamp(14) is older than x
>> minutes.
>
> You haven't said which version of MySQL you're using.
>
> That said:
> DATE_SUB.
>
> select * from support_start where time_stamp_field > date_sub(now, interval x
> minute);
>
> Sub for time_stamp_field and x as needed.
Version 3.x, I assume this is a 4.X feature since you brought it up?
--
-------------------------------------------------------------
Scott Haneda Tel: 415.898.2602
http://www.newgeo.com Fax: 313.557.5052
scott@stripped Novato, CA U.S.A.