Re: DateTime Calculations

2002-12-04 Thread Keith C. Ivey
On 3 Dec 2002, at 10:45, Peter Abilla wrote: > Column One Column Two > 1999-09-17 16:30:18 1999-09-18 13:30:18 > > I want to calculate the minutes like > > (Column Two - Column One) = Total Minutes Something like ( UNIX_TIMESTAMP(column2) - UNIX_TIMESTAMP(column1) ) / 60 ? > K

Re: DateTime Calculations

2002-12-03 Thread Jeff Kilbride
Try this: select sec_to_time(unix_timestamp(column_two) - unix_timestamp(column_one)) Should give you the elapsed time in hh:mm:ss format. --jeff - Original Message - From: "Peter Abilla" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 8:45 AM Subject: DateT

Re: DateTime Calculations

2002-12-03 Thread Pablo
On 12/3/02 10:45 AM, Peter Abilla ([EMAIL PROTECTED]) wrote: > Suppose I have a datetime in the following format: > > Column One Column Two > 1999-09-17 16:30:18 1999-09-18 13:30:18 > > I want to calculate the minutes like > > (Column Two - Column One) = Total Minutes > > I've

Re: DateTime Calculations

2002-12-03 Thread Steve Yates
On Tue, 03 Dec 2002 10:45:57 -0600, Peter Abilla wrote: >(Column Two - Column One) = Total Minutes Assuming this doesn't work :) perhaps select UNIX_TIMESTAMP(col2) - UNIX_TIMESTAMP(col1) as TimeDiff This should give you an answer in seconds. [sql] - Steve Yates - File not found. S

Re: DateTime Calculations

2002-12-03 Thread Cory Hicks
Peter, I would do something like this: (UNIX_TIMESTAMP(Column Two) - UNIX_TIMESTAMP(Column One))/3600 to give you the hoursnot sure about the minutes, but this should get you going! HTH, Cory '$valid_user' "; On Tue, 2002-12-03 at 10:45, Peter Abilla wrote: > Suppose I h

Re: DateTime Calculations

2002-12-03 Thread Rodney Broom
From: Peter Abilla <[EMAIL PROTECTED]> > (Column Two - Column One) = Total Minutes This is quite a hack, and there's probably a better way. But it works: SELECT ROUND( (unix_timestamp(column_one) - unix_timestamp(column_two)) /60 ) as my_minutes; > I've scoured the mysql site and haven't f