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: DateTime Calculations


> 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 scoured the mysql site and haven't found something that addresses
this.
> Any ideas?
>
> Keyword: sql, query
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to