decimal day to standard hours, help please

S

steve a

Hi i have a column which displays a defined time period in decimal days, and
was wanting to change the format into hours, the problem being that some
periods are longer than 24 hours.. What do i need to put in the format
section of the queries properties?
i've tried [h]:nn as excel, but no joy!
 
J

Jeff Boyce

Is this an Excel or an Access question?

If you have 2.5 decimal days, that would be 2.5 X 24 to get hours. The
whole number is hours, the "fraction" is parts of an hour, which you can
convert to minutes by multiplying X 60.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
M

Marshall Barton

steve said:
Hi i have a column which displays a defined time period in decimal days, and
was wanting to change the format into hours, the problem being that some
periods are longer than 24 hours.. What do i need to put in the format
section of the queries properties?
i've tried [h]:nn as excel, but no joy!


The date/time formats do not deal with time durations so you
need to use a text box or query field expression ro
calculate what you want to display.

Try this kind of thing:

Int(24*days) & Format(Int(24*60*days) Mod 60, "\:00")
 
S

steve a

Hi Marshall
Tried that and it works.. That's great thanks very much for your quick
responce and help.. spot on!
thanks again.
steve

--
steve adlam


Marshall Barton said:
steve said:
Hi i have a column which displays a defined time period in decimal days, and
was wanting to change the format into hours, the problem being that some
periods are longer than 24 hours.. What do i need to put in the format
section of the queries properties?
i've tried [h]:nn as excel, but no joy!


The date/time formats do not deal with time durations so you
need to use a text box or query field expression ro
calculate what you want to display.

Try this kind of thing:

Int(24*days) & Format(Int(24*60*days) Mod 60, "\:00")
 

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