If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > check time difference

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-08, 08:34
esthera esthera is offline
Registered User
 
Join Date: Jun 2006
Posts: 66
check time difference

i have a field called datemodified

How can I run a select statement to check if 5 minutes have passed from the datemodified or not?
Reply With Quote
  #2 (permalink)  
Old 01-08-08, 09:00
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
WHERE datemodified < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 MINUTE)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 01-08-08, 09:00
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
[strikeout]Look up date_diff in the manual[/strikeout]

EDIT: or not
__________________
George
Twitter | Blog
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On