SELECT UNIX_TIMESTAMP(timestamp2)-UNIX_TIMESTAMP(timestamp1) as
difference from table;
gives you the time in seconds between the 2
SELECT
sec_to_time(UNIX_TIMESTAMP(timestamp2)-UNIX_TIMESTAMP(timestamp1)) as
difference from table;
gives you the time in Days+HH:MM type format
see for additional functions to vary up what you are trying to get
http://www.mysql.com/doc/en/Date_and_time_functions.html
On Fri, 2003-10-10 at 12:05, Jeff McKeon wrote:
> I have two columns in a table, both timestamp(14). The first one holds
> a start date and the second one holds an end date. Is there any built
> in mysql function to subtrack timestamp1 from timestamp2 and get the
> elapsed time between?
>
> Thanks,
>
> Jeff
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--
Woody
In a world without boundaries why
do we need Gates and Windows?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]