Re: Finding records within 15 minutes from now?

From: Date: Tue, 12 Apr 2005 22:12:07 +0000
Subject: Re: Finding records within 15 minutes from now?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-212957@lists.php.net to get a copy of this message
Are you saying you want all records whose timestamp is less than now plus 15 minutes? If so... SELECT ... WHERE ts_col <= CURRENT_TIMESTAMP + INTERVAL 15 MINUTES; should do it I'd think. see here for more (the DATE_ADD function) http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html On Tue, 12 Apr 2005, J J wrote:
I'm struggling with the php or mysql query to find records within my database that are within 15 minutes from now and prior. Example: It's 2:30pm on 4/12/05 I need to find all records with a RecordTime of 2:45pm and previous. So it should find: rec1 time: 2:45 date: 4/12/05 rec2 time: 2:00 date: 4/12/05 rec3 time: 1:30 date: 4/8/05 etc. It would not find: rec4 time: 3:15 date: 4/12/05 rec5 time: 4:00 date: 4/23/05 Make sense? I'm reviewing the manuals for datediff, curdate and other functions but nothing seems to be making sense for what I need. Any ideas? Thank you in advance! __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#212957) next »