You must make sure you don't perform arithmetic differences between integer
values such as "2000" representing 8:00 pm and "1945" representing 7:45 pm
because that obviously would result in wrong values. For example 2000-1945=55,
which is arithmetically correct but not the desired result if you want those
values to represent minutes, right?

So what you must do is either store the value as time or timestamp and perform
arithmetic difference between unix_timestamp() values (as in "update
time_worked set total =
from_unixtime(unix_timestamp(finish)-unix_timestamp(start),'%H:%m');") or store
the values as convenient integer types and make sure you treat them as time
values from PHP or whatever you're programming in.

HTH

Bogdan

Alex Kirk wrote:

> I was using float...but even when I changed it to time, MySQL still gave me
> odd values on those rows. What type should I use?
>
> Alex Kirk


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