SteveL13
asked on
Calculate number of hours using two field
I have a form which has two fields. They are "StartTime" and "StopTime".
In the bound table I have a calculated field named "ElapsedTime". I want to have that field populate with [StopTime] - [StartTime] in hours.
If StartTime for example is "4/16/2014 2:53:50 PM"
and
If StopTime for example is "4/16/2014 3:01:05 PM"
then the elapsed hours would be something like .13 right?
Anyway, how can I make the calculated field get the right result? I have it setup as Long Integer, Standard, 2 decimals but it isn't working correctly.
--Steve
In the bound table I have a calculated field named "ElapsedTime". I want to have that field populate with [StopTime] - [StartTime] in hours.
If StartTime for example is "4/16/2014 2:53:50 PM"
and
If StopTime for example is "4/16/2014 3:01:05 PM"
then the elapsed hours would be something like .13 right?
Anyway, how can I make the calculated field get the right result? I have it setup as Long Integer, Standard, 2 decimals but it isn't working correctly.
--Steve
Set the field as General or as a Number if you want to fix decimal points.
Multiply the answer by 24 to get hours.
Or multiply the answer by 1440 to get minutes. 1440 = 24 * 60.
Multiply the answer by 24 to get hours.
Or multiply the answer by 1440 to get minutes. 1440 = 24 * 60.
ASKER
This isn't quite getting it. Again:
If StartTime for example is "4/16/2014 2:53:50 PM"
and
If StopTime for example is "4/16/2014 3:01:05 PM"
then the elapsed hours would be something like .13 right?
How do I get the calculated field to read .13 ?
If StartTime for example is "4/16/2014 2:53:50 PM"
and
If StopTime for example is "4/16/2014 3:01:05 PM"
then the elapsed hours would be something like .13 right?
How do I get the calculated field to read .13 ?
See attached spreadsheet
Hours.xlsx
Hours.xlsx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are fast!
/gustav
/gustav
Isn't that exactly what I gave you in the spreadsheet??
Well, this is Access, and rounding was missing.
/gustav
/gustav
Sorry. Don't know where I got Excel from!
If you use single or double as field type, it should work.