Hey everyone just a quick question that I'm having trouble tracking down the answer to. I've got a report where I spit out a bunch of employee's hours worked for the day and I also need a total of everyone's hours. How do you format hours on a report to go over 24?
Ex: I've got an HoursWorked field (EndTime-StartTime as hh:mm) and right now I just have =Sum([SalesTotal]) right now but it's not working the way I need it. So 12:15+15:30 is coming up as 3:45 instead of 27:45... I'm new to Access and not sure how to format this the way I need, any help?
Function SumTime(Time1 As Variant, Time2 As Variant) As String
Dim DPart As Integer
Dim TotalH As Integer
Dim TotalM As Integer
Dim Total As Variant
Total = Time1 + Time2
DPart = CLng(Total) * 24
TotalH = Val(Format(Total, "hh:mm")) + DPart
TotalM = Val(Mid(Format(Total, "hh:mm"), 4))
SumTime = Format(TotalH, "00") & ":" & Format(TotalM, "00")