Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2009

    Unanswered: Really simple Access Report Question

    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?

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    Here is one possible solution:
    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")
    End Function
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts