2 messages in com.mysql.lists.mysqlRe: Date Calculation
FromSent OnAttachments
Oswaldo Castro08 Aug 2003 06:16 
Keith C. Ivey08 Aug 2003 07:40 
Subject:Re: Date Calculation
From:Keith C. Ivey (kei@smokefreedc.org)
Date:08/08/2003 07:40:31 AM
List:com.mysql.lists.mysql

On 8 Aug 2003 at 10:16, Oswaldo Castro wrote:

I have two datetime fields on my database. I nedd to return the difference in minutes between them. I tried date_sub, extract(hour_minute from ...) and it does't work

SELECT ( UNIX_TIMESTAMP(datetime2) - UNIX_TIMESTAMP(datetime1) ) / 60;

(assuming the dates are within the 1970-2037 range).