3 Replies Latest reply on Sep 8, 2011 7:31 AM by straka_sh

# Time Elapsed Calculation Pre/Post Midnight

### Title

Time Elapsed Calculation Pre/Post Midnight

### Post

We use FM for our time clock... one problem we are having at harvest time is some people start work before midnight and end shift after midnight but the calculation is always coming back strange.

This is what I tried...

((Time Out 01 Calc + Time (24 ; 0 ; 0)) - Time In 01 Calc) - Time (0; 30; 0))

For a person who punched in at 1:49 PM and punched out at 12:55 PM, the result is -13:23.

The reason for the calculation would be (0 ; 55 ; 0) + (24 ; 0 ; 0) = 24;55;0 then subtract 13;49;00 to get 11;06;0 hours worked and subtract 30 minutes for lunch...

• ###### 1. Re: Time Elapsed Calculation Pre/Post Midnight

So... the problem is how to get around the midnight issue... and the negative/incorrect values for elapsed time...

• ###### 2. Re: Time Elapsed Calculation Pre/Post Midnight

Easiest way is to collect (or generate) the date and time of the clockings into a TimeStamp, and subtract the two.  Filemaker will look after all the midnight business.

• ###### 3. Re: Time Elapsed Calculation Pre/Post Midnight

I think I figured it out a different way, too...

I just added an and statement to the Case( calculation that said Day in = Day out for people that punch out on the same day... and those who cross over midnight will hit the Case( Day in does not equal Day out)...

It works...