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). -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]