format time greater than 24 hours

  • Thread starter Thread starter css
  • Start date Start date
C

css

I have a running sum in my report that is formatted as a short time. Once the
sum becomes greater that 24:00, it resets to zero.

How can I display 25:37 in my report?

Thanks,
Connie
 
Use DateDiff() to get the number of minutes.

Set up a text box in the report footer, with these properties:
Control Source =DateDiff("n", #0:00#, Sum([YourTimeFieldNameHere]))
Format General Number
Visible No
Name txtMinutes

Now place another text box in the same section, with Control Source:
=[txtMinutes] \ 60 & Format([txtMinutes] Mod 60, "\:00")

Explanation:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html
 
Thanks, Allen!!

Allen Browne said:
Use DateDiff() to get the number of minutes.

Set up a text box in the report footer, with these properties:
Control Source =DateDiff("n", #0:00#, Sum([YourTimeFieldNameHere]))
Format General Number
Visible No
Name txtMinutes

Now place another text box in the same section, with Control Source:
=[txtMinutes] \ 60 & Format([txtMinutes] Mod 60, "\:00")

Explanation:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

css said:
I have a running sum in my report that is formatted as a short time.
Once the sum becomes greater that 24:00, it resets to zero.

How can I display 25:37 in my report?

Thanks,
Connie
 
This is a great fix, thanks, except when I try to view the report I get a prompt to enter a perameter value for textminutes. Did I do something wrong?
Melissa
 
Never mind. I named the text box "TextMinutes" instead of "TxtMinutes". Fixed it and now it's working beautifully.
Thank you for posting this!
Melissa
 
Back
Top