[AccessD] Tip: Sum elapsed time and display as a time string

Arthur Fuller fuller.artful at gmail.com
Wed Feb 4 04:54:04 CST 2009


Wow. I didn't know that, Gustav! Thanks.
Arthur

On Wed, Feb 4, 2009 at 2:27 AM, Gustav Brock <Gustav at cactus.dk> wrote:

> Hi all
>
> Did you know how easy it is in a query to sum elapsed time (of date/time
> value) and format this as a string even when count of hours exceed 24?
>
> SELECT
>    DateDiff("h",0,Sum([ElapsedTime])) &
>    Format(Sum([ElapsedTime]),":nn:ss") AS
>  ElapsedTimeTotal
> FROM
>  tblElapsedTime;
>
> This will return a string like, say, 45:37:12.
>
> The trick is, of course, to count the hours from date/time value 0 (zero).
> Then let Format handle the minutes and seconds.
>
> /gustav
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



More information about the AccessD mailing list