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 > Calculating the difference in timestamps

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-23-07, 05:09
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 791
Calculating the difference in timestamps

Hi everyone,

I have a situation that requires me to calculate two fields that both have timestamps in this form "2007-09-27 18:23:03".

Maybe there is a better way to do this, but I thought I would find the difference between the two timestamp fields to come up with a difference in minutes and then average them.

Can someone please help by maybe providing an example or by pointing me in the right direction?

Last edited by Frunkie; 09-23-07 at 05:12.
Reply With Quote
  #2 (permalink)  
Old 09-23-07, 06:46
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 09-23-07, 07:53
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by georgev
When in doubt "RTFM"

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 09-23-07, 15:52
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 791
Thanks guys! That was what I needed.
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