How do I convert hourly time to decimal time?

F

F135FTE

Finally figured out how to calculate a time difference and would like to
convert it to a format that is used in my workplace.

If I enter a landing time of 16:30 and a takeoff time of 17:36, the total
flight time is 1:06. However, our format is decimal-based, not
hours:minutes. That is, for this example, the total flight time would be 1.1
hours. If the total flight time is 1:08, it would still be 1.1 hours
(rounded off). It would go up to 1.2 hours when the flight time changed to
1:09.

Is there a formula that can inputted into the expression builder that would
convert the total flight time from hours:minutes to decimal?
 
D

Douglas J. Steele

Sneaky little trick. Times are stored as a fraction of a day (i.e.: 6:00 is
..25, 12:00 is .5, 18:00 is .75 and so on).

If you multiple the time by 24, you'll get its value in decimal time:

?#1:06#*24
1.1
?#1:08#*24
1.13333333333333
?#1:09#*24
1.15

(The reason I call this a sneaky trick is that it's really a misuse of the
Date datatype. As you may have noticed, Access doesn't have a Time datatype,
and the Date datatype is really intended to be a timestamp, not a time
duration.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top