dbTalk Databases Forums  

Hours worked

comp.databases.filemaker comp.databases.filemaker


Discuss Hours worked in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jamie Bah
 
Posts: n/a

Default 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.
ex.
arrived 08:00
depart 17:00

17:00-8:00= 9

Works great until you go past 23:59.
ex.
arrive 21:00
depart 0:30

21:00-0:15= -20:45

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

Reply With Quote
  #2  
Old   
Glenn Schwandt
 
Posts: n/a

Default Re: Hours worked - 07-09-2004 , 08:32 AM






"Jamie Bah" <jamiebah (AT) hotmail (DOT) com> wrote

Quote:
I need to find the hours worked by subtracting the time started from the
time finished, time worked may cover more than one day.
ex.
arrived 08:00
depart 17:00

17:00-8:00= 9

Works great until you go past 23:59.
ex.
arrive 21:00
depart 0:30

21:00-0:15= -20:45

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
Time-Arrival Time
(Departure Time - Arrival Time) + ((Departure Time < Arrival Time) * 86400)




Reply With Quote
  #3  
Old   
Peter
 
Posts: n/a

Default Re: Hours worked - 07-09-2004 , 09:15 AM



Quote:
Works great until you go past 23:59.
ex.
arrive 21:00
depart 0:30

21:00-0:15= -20:45
I'm assuming you meant 0:30-21:00 = -20:30 otherwise you lost me.

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 :

Worktime =

If(DepTime < ArrTime ; DepTime - ArrTime + Time(24;00;00); DepTime -
ArrTime)

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.

Peter


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.