Hours worked - 07-09-2004 , 08:19 AM
I need to find the hours worked by subtracting the time started from the
time finished, time worked may cover more than one day.
Works great until you go past 23:59.
So, my question is, what is the correct way to calculate the amount of
time that I spent at the customer's place?
The 2 fields (Departure Time and Arrival Time) that are being subtracted
are time fields and my total hours field is an auto-caculate: Departure
Re: Hours worked - 07-09-2004 , 08:32 AM
"Jamie Bah" <jamiebah (AT) hotmail (DOT) com> wrote
Re: Hours worked - 07-09-2004 , 09:15 AM
If the total work time can be more than 24 hours you will need an
additional field for days. Then you could do something like :
WorkTime = DepTime - ArrTime + (Time(24:00:00) * days)
If this is not going to happen (which I assume, otherwise you're making
long hours...), do this :
If(DepTime < ArrTime ; DepTime - ArrTime + Time(24;00;00); DepTime -
or alternatively (same, but differently phrased)
DepTime - ArrTime + ((DepTime < ArrTime) * Time(24;00;00))
You mention WorkTime is an autocalc, which I take to mean an auto-enter
calculation. It's better to just make it a plain calculation field, type
time, so it will automatically update when you change either of the two
time fields. An auto-enter calculation does not update it there's already a
result in the field.