View Full Version : MS Access Report convert minutes number to HH:MM


BigGummy
05-13-2003, 11:38 AM
This is for a MS Access Report .
I'm trying to convert minutes number to HH:MM
User has 75 minutes for sumofduration
In the report I have
=Format([SUMOFDURATION]/(24*60),"Short Time")
and this works fine,
BUT, now any time the number of hours go over 24, the sum starts over at 1.
For example: 23 hours and 15 minutes displays as
23:15
But 25 hours and 15 minutes displays as
01:15
If I use this method I need to make sure that the HH continue to increment past 24 so that I can display 25:15, 101:20, 1001:40, etc.
Thank you in advance for your reply

Pat Hartman
05-14-2003, 12:12 PM
The date/time data type is intended to store a point in time. It is not intended to store (or in your case display) elapsed time. You will need to convert the minutes to hours and format a string yourself.

=SUMOFDURATION\60 & ":" & SUMOFDURATION MOD 60

Notice the use of \ rather than / as the divide operator.