AlanP Posted July 13, 2005 Posted July 13, 2005 Is there a way to show a field with a calcuation that shows time elapsed based on two fields? For example there is a "Start Time" field and "End Time" field (so say "1200" to "1315" military time) and the calcuation field would show "1:15" for the time elapsed. Hope that makes sense and THANK YOU in advance for anyone who knows how to make this calculation!
Ender Posted July 13, 2005 Posted July 13, 2005 If they are time fields, you can simply take the difference: End Time - Start Time
Vaughan Posted July 13, 2005 Posted July 13, 2005 ... except of course when the end date is past minight, in which case you'll end up with a negative result. To solve this you need to take the start Date and End Date into account. End Time - Start Time + ( End Date - Start Date ) * 3600 * 24 The "3600 * 24" is there because time is measured in seconds, while dates are measured in in days. There are 3600 * 24 seconds in a day.
Recommended Posts
This topic is 7142 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