Sum of (calculated)Time

Faction21

Registered User.
Local time
Today, 06:31
Joined
Oct 26, 2004
Messages
42
TotalTime: Sum(Format([PageCounts].[StartTime]-[PageCounts].[EndTime],"Short Time"))

Access says "inccorect data type " when i try to execute this command in the Field Row of a select query. It runs fine without the Sum, but i get individual totals for every record, when i need just one overall Sum of all time. Is it possible to do this?

-Thanks
 
The expression should be [EndTime]-[StartTime]. You can Sum the expression before formatting:-

TotalTime: Format(Sum([PageCounts].[EndTime]-[PageCounts].[StartTime]),"Short Time")


If TotalTime is greater than 24 hours, you may find the sample database by Jon K helpful:-
http://www.access-programmers.co.uk/forums/showthread.php?t=62733

~
 
Last edited:
Thanks man, I'll try it out.
 

Users who are viewing this thread

Back
Top Bottom