Sum Time Difference in report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdpems
    New Member
    • Sep 2007
    • 17

    Sum Time Difference in report

    I am currently working on creating a Clock in/out form for our work place. I have the form done but the only way that I can get the time differences to work properly is to leave the Total time for the day worked as a text field. If I change this field to a number or hh:mm it rounds up to the nearest hour and I don't want this. It needs to be as if some one clocked in at 0800 and out at 2030 the time total would reflect 12.50. I got it to do this by leaving the field as a text, but when I try to generate a report with several days of info on it it returns an error. I am using the code.

    Total.Value =([Time out] - [Time in]) *24
    this is for me to get the total for the day. If I do this anyother way it is returning a single number rounded to the next hour.

    In my report I created an unbound text box named Total and have it's control set to =SUM([Total]

    Can anyone help.
    Thanks
  • MindBender77
    New Member
    • Jul 2007
    • 233

    #2
    I just did a project a few weeks ago similar to yours. Try this, it might produce the result your looking for:

    Code:
    TimeDifference: DateDiff("s",[LogIn Time],[LogOut Time])/3600
    Translation: Show the date difference between LogIn Time and LogOut Time in seconds and divide by 3600 to produce hours.

    Bender

    Comment

    • mdpems
      New Member
      • Sep 2007
      • 17

      #3
      I tried this and I am getting the same results. I plugged in my data that someone would clock in at 0745 and Clock out at 2030. What I want is for it to return 12.75. I can get it to do this if I go into the table and set the field to "text". If I set the field to "number" it rounds the number up to the next whole number not as the decimal. I can't get it to add these values together in the text field. Any help
      Thanks

      Comment

      • mdpems
        New Member
        • Sep 2007
        • 17

        #4
        Stupid me. I was putting my total formula in my report in the wrong place. I was putting it in the page footer instead of the report footer. Moved the formula and worked fine. Thanks.

        Comment

        Working...