January 10, 200818 yr I'm working on a time card and have 1 field "Time In" and 1 field "Time Out". As long as the time is within one 24 hour period, it calculates perfectly (in time, not numbers) But if a person signs in at 11:00 at night and signs out at 7:00 the next morning then the problems begin. I've tried an if formula, but to no avail. Can these two different sign ins be compatible? Thanks for any help.
January 10, 200818 yr You could use the Case() statement in a calculation to take care of the problem. For example, using the 24-hour time format, your sample would be: Time In: 23 Time Out: 07 Then I can use the calculation: Case (Time In > Time Out; Time Out + 24 - Time In;Time Out - Time In) In other words, if the Time In is greater than the Time Out value, add 24 hours to Time Out before subtracting Time In, which will give you the correct number; otherwise, just subtract Time In from Time Out. Of course, you would alter the calculation to deal with time values rather than straight numbers, but hopefully this will put you on the right track. -Stanley
January 10, 200818 yr Either that or switch the fields to Timestamp type. See also: http://fmforums.com/forum/showtopic.php?tid/183791/post/236635/#236635
January 10, 200818 yr Author This worked great TimeFinish - TimeStart + ( TimeFinish < TimeStart ) * 86400 Thanks so much.
Create an account or sign in to comment