Newbies myxology Posted May 7, 2008 Newbies Posted May 7, 2008 I am trying to finish a database that will track job time. I have a start time and a finish time. I was going to subtract the start time from the finish time and use that as a calculation for the duration of work. I understand that the results of that subtraction is in seconds. How do I convert that duration to hours and round that to the nearest half hour.
Lee Smith Posted May 7, 2008 Posted May 7, 2008 Take a look at the Rounding Time at Database Pros site Link
Newbies myxology Posted May 7, 2008 Author Newbies Posted May 7, 2008 Lee, thanks for the link. Unfortunately, that file is created in FM7. I only have FM6. Going to need to upgrade soon, I'm sure, but can't do it now and still need to figure this out. Any other help out there?
Lee Smith Posted May 7, 2008 Posted May 7, 2008 (edited) Dog gone it, he upgraded it. I have an old copy of it around here, give me a couple of minutes, and I'll upload it. Lee It was a version 3 file, which I converted to v5 TIMEUP.FP5.zip Edited May 7, 2008 by Guest added file
Newbies myxology Posted May 7, 2008 Author Newbies Posted May 7, 2008 oh, this is kinda funny, kinda not funny. I went back in and checked my calculation and I think it was working fine. I hadn't paid attention to the fact that I was working with around 23 minutes that I was trying to round and had not inspected the seconds. I found that the number was being rounded properly, where mentally I was rounding the other direction because I hadn't accounted for the seconds. At any rate, here is the calculation I'm using. If you see any gross errors, I'd like to hear about them. But I think it's working correctly. Finish time and start time are fields that I am populating with "current time" stamps at the click of a button. Round(Round(([finish time]-[start time])/900,0) * 900 / 60 / 60, 2)
comment Posted May 7, 2008 Posted May 7, 2008 I would think one 'round' of rounding should be quite sufficient. If, as it seems, you want to round to the nearest quarter-hour (not half-hour as stated originally) Round ( ( [finish time] - [start time] ) / 900 , 0 ) * 0.25
Recommended Posts
This topic is 6104 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