merkaba22 Posted April 23, 2008 Posted April 23, 2008 (edited) I have an application where time is entered as a number based on a 24 hour clock without separators (such as ":"); for example, the "start time" of 8:30 AM would be entered as 0830 and "finish time" of 4:00PM would be entered as 1600. I would like a way to calculate the total time (duration) between two such entries that results in a number not time. Obviously, a simple calc: Total Time = "finish time" - "start time" for on the hour entries is simple but in the case above, the calc would generate 730 and the preferred result would be 7.5 (hours). Edited April 23, 2008 by Guest
comment Posted April 23, 2008 Posted April 23, 2008 Try: Div ( end ; 100 ) - Div ( start ; 100 ) + ( Mod ( end ; 100 ) - Mod ( start ; 100 ) ) / 60
merkaba22 Posted April 24, 2008 Author Posted April 24, 2008 Thank you -- that works great:) I furthered this to account for durations that go into at least the next day: Div ( end ; 100 ) - Div ( start ; 100 ) + ( Mod ( end ; 100 ) - Mod ( Start ; 100 ) ) / 60 + ((returndate_calc - begindate_calc) * 24)
Recommended Posts
This topic is 6117 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