459,492 Members | 1,199 Online Need help? Post your question and get tips & solutions from a community of 459,492 IT Pros & Developers. It's quick & easy.

# Sum Time Function.

 P: n/a Hi Group (fairly limited knowledge of Access and almost none of Access VBA. Using Access 2003). I need to sum time, I've found through the groups archive an sql extract that led me to this SELECT Format(Sum(Table2.time),"Short Time") AS SumOftime FROM Table2; Which works fine but the article also said I would need a Function to deal with sum when it exceeded 24. I think I might of found it but could do with a direct explanation or a little help with what I found Function GetElapsedTime(interval) Dim totalhours As Long, totalminutes As Long, totalseconds As Long Dim days As Long, hours As Long, Minutes As Long, Seconds As Long days = Int(CSng(interval)) totalhours = Int(CSng(interval * 24)) totalminutes = Int(CSng(interval * 1440)) totalseconds = Int(CSng(interval * 86400)) hours = totalhours Mod 24 Minutes = totalminutes Mod 60 Seconds = totalseconds Mod 60 GetElapsedTime = days & " Days " & hours & " Hours " & Many thanks in anticipation Don Nov 8 '07 #1 