Thanks John, that worked great in my forms and reports. One other issue I am
now having is that I want to summarize a number of elapsed times on a report.
I put the following formula in the control source for a text box in the
group footer:
=Sum([ElapsedTime]\3600 & Format(([ElapsedTime]\60) Mod 60,"\:00") &
Format([ElapsedTime] Mod 60,"\:00"))
When I run the report I get an error message about the expression being
typed wrong or being too complex to be evaluated. If I put the formula:
=Sum([ElapsedTime])
I get the correct number of seconds. Again, I want to display this as
hh:mm:ss but the total for either the report or the group in the report.
For example, one section has a total sum of 24421 seconds of elapsed time.
What do I need to do to get the resulting display in the group footer to show
06:47:01 (i.e., 6 hours 47 minutes and 01 seconds).
Thanks.
Dave Schoeffel
> >For example: What format can I use to show 01:02:15 (i.e., 1 hour 2 minutes
> >15 seconds) from the calculation in the DateDiff function that returns 3735
[quoted text clipped - 4 lines]
>
> John W. Vinson [MVP]
John W. Vinson - 03 Mar 2007 21:46 GMT
>=Sum([ElapsedTime]\3600 & Format(([ElapsedTime]\60) Mod 60,"\:00") &
>Format([ElapsedTime] Mod 60,"\:00"))
[quoted text clipped - 6 lines]
>I get the correct number of seconds. Again, I want to display this as
>hh:mm:ss but the total for either the report or the group in the report.
You need to replaced the last two [ElapsedTime] references with
Sum([ElapsedTime])
It's not the elapsed time that you want to display formatted - it's
the SUM that you want to display!
Don't worry too much about including the Sum() three times - I'm
pretty sure that Access is smart enough to just sum it once and use
the same result; if not... cpu cycles are cheap these days...
John W. Vinson [MVP]