Convert Minutes to Hours:Minutes

Convert Minutes to Hours:Minutes

Post by Bern » Fri, 30 Jun 2006 06:01:08


Can anyone please point me in the right direction

I have a running total of Minutes in a report and would like to display it
at the end in the following format:

HH:MM

I'm using the following:

=Sum([LogTime])/60

But the answer has the correct hours but not the minutes

any help is appreciated
 
 
 

Convert Minutes to Hours:Minutes

Post by OfficeDev1 » Fri, 30 Jun 2006 06:59:59

Berny,

Divide the number of minutes by (24 hours X 60 minutes). (1440). Then format
the result as hours and minutes. Eg. For 15 minutes in a double numeric
variable called XMin, use

DisplayField = Format(XMin / 1440, "hh:nn")

Don't use "mm" but "nn". "mm" means 'months' to Access' Format() function.
You might look it up in the help file. Make sure to read the examples there.

Hope this helps,

Sam



--
Sam

Message posted via AccessMonster.com
http://www.yqcomputer.com/

 
 
 

Convert Minutes to Hours:Minutes

Post by Marshall B » Fri, 30 Jun 2006 07:08:38


=Sum(LogTime) \ 60 & ":" & Format(Sum(LogTime) Mod 60, "00")

--
Marsh
MVP [MS Access]
 
 
 

Convert Minutes to Hours:Minutes

Post by T2ZlciBDb2 » Fri, 30 Jun 2006 07:19:01

Hi Sam
I like that idea, but the problem with it, that it will work only up to 24
hours

--
Good Luck
BS"D
 
 
 

Convert Minutes to Hours:Minutes

Post by Bern » Fri, 30 Jun 2006 09:29:23

Thank you,

That did the trick!!!!
 
 
 

Convert Minutes to Hours:Minutes

Post by Bern » Fri, 30 Jun 2006 09:29:37

Thank you