ABCRobstown Posted January 10, 2008 Posted January 10, 2008 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.
stanley Posted January 10, 2008 Posted January 10, 2008 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
comment Posted January 10, 2008 Posted January 10, 2008 Either that or switch the fields to Timestamp type. See also: http://fmforums.com/forum/showtopic.php?tid/183791/post/236635/#236635
ABCRobstown Posted January 10, 2008 Author Posted January 10, 2008 This worked great TimeFinish - TimeStart + ( TimeFinish < TimeStart ) * 86400 Thanks so much.
Recommended Posts
This topic is 6222 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now