On Wednesday 11 December 2002 12:44, Tom Roos wrote:

> i want to build a query in which i have 2 datetime fields which i subtract
> from one another. what is the result set? is it in (milli)seconds, is it a
> unix timestamp?
> what type of convertion do i have to apply to report the difference in 
minutes?

You can't apply arithmetics on datetime fields directly. You can do it like
UNIX_TIMESTAMP(column1)-UNIX_TIMESTAMP(column2)

and you get difference in seconds

(UNIX_TIMESTAMP(column1)-UNIX_TIMESTAMP(column2))/60 - in minutes




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
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