A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I convert hourly time to decimal time?



 
 
Thread Tools Display Modes
  #1  
Old September 27th, 2006, 06:21 PM posted to microsoft.public.access.forms
F135FTE
external usenet poster
 
Posts: 1
Default How do I convert hourly time to decimal time?

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?
  #2  
Old September 27th, 2006, 07:14 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default How do I convert hourly time to decimal time?

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.)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"F135FTE" wrote in message
...
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?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.