Calculating from Time Fields

For HanDBase related topics that are not specific to one platform.

Calculating from Time Fields

Postby Gab-Hop » Fri Sep 26, 2014 8:40 pm

Hello Dave/Brian
I have a simple DB for recording time sheets
which has a start time (Time field) and an end time (Time field)
from this I use a calculated field with time output value to show the total hours spent by subtracting the end time from the start time
This works fine within a 24 hr. day
But if the shift starts at say 09:00pm and ends at 08:00am the following day (night shift) the result is -13:00:00
is there a way to still show the total hours if the times are cutting across from one day to the next?
I am also using a date field to show the date that the work was done on
Can this be somehow used in the equation ?
How can I record the Total Hours on night shift ???
Gab-Hop
 
Posts: 45
Joined: Mon Jan 13, 2014 11:34 pm
Location: New Zealand

Re: Calculating from Time Fields

Postby dhaupert » Fri Sep 26, 2014 9:30 pm

Hi there,

Thanks for your question- it's one we've had several times before! Here's a link to one where I explained a solution:
viewtopic.php?f=6&t=805&p=3025&hilit=midnight#p3025

If you ever think you may be spending more than a 24 hour period, you may want to do it this way instead:
viewtopic.php?f=6&t=1373&p=5882&hilit=duration#p5882

hope this helps!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Calculating from Time Fields

Postby Gab-Hop » Sat Sep 27, 2014 4:29 am

Thanks Dave
Worked perfectly
Great support
Gab-Hop
 
Posts: 45
Joined: Mon Jan 13, 2014 11:34 pm
Location: New Zealand


Return to HanDBase General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest