Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    May 2003
    Posts
    47

    Unanswered: Running sum hours returns incorrect sums

    I have a table with an hoursworked field in short time format , however when I try to use running some on the hoursworked field I get incorrect sums when the hours exceed 24hrs . Does any body have a workaround for this ?

  2. #2
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    if all you are doing is summng hours such as totalnumber of hours - try using a number format - I would have to see the data to give a better idea but a total number of hours is not time it is a number.

    Let me know if this helps or if you want me to look at an example.

  3. #3
    Join Date
    May 2003
    Posts
    47

    time calc

    When I swithch the text box ( and the table field ) to a general number it calculates to 0.00 . To explain it better , I have a Clockin field and a Clockout field and an hoursworked field . Clockin and Clockout are populated by "setvalue Now()" via a button . hoursworked is populated by "setvalue Clockout - Clockin " so all fields are populated by date formats and everything is correct except when i try to do a sum in a report
    .

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    I wrote Project Mgmt app that does exactly that - let me find the code and see how I did it - give me about 15 - 20 minutes - maybe faster

  5. #5
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    TTime = ETime - STime was my formula

    Ttime is a field whose format I set to standard and decimal places 2
    Stime is start time whose format is set to short time
    Etime is end time whose format is set to short time

  6. #6
    Join Date
    May 2003
    Posts
    47

    okay

    i'll try that and see what happens

  7. #7
    Join Date
    May 2003
    Posts
    47

    not working

    not working , I either get a zero returned or I get 0.30934234222354 when I should be getting 6:34 hrs ? I'm doing this directly in the table and getting these results . When I set all three fields to short date , the hours worked is correct , the problem comes when i go to create a total in a report . I assign the text box to hoursworked and then set it to running sum , I change the format to number and the results are crazy .

  8. #8
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    send sample data with the result you want and i will provide the solution

  9. #9
    Join Date
    May 2003
    Posts
    47

    here it is

    The report in question is lat7days , I know the data is not correct for the hoursworked compared to the clockin / clockout times , this was due to me changing formats and blowing out the old data . it still gives me the same results on the report though .
    Attached Files Attached Files

  10. #10
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    tried to open with Access 2000 and got unrecognized file format what format is the file in?

  11. #11
    Join Date
    May 2003
    Posts
    47

    unzipped ?

    Did you unzip it first ? its a 2000 file , should open fine ? I zipped it using winrar so it was sent as a RAR file .

  12. #12
    Join Date
    May 2003
    Posts
    47

    here is another

    this is a zip file
    Attached Files Attached Files

  13. #13
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    here you go - look at the query
    qryupdatetime

    I changed the datatype in the clock table for hourworked to be a number - standard format - 2 deciaml places

    Attached Files Attached Files

  14. #14
    Join Date
    May 2003
    Posts
    47

    Okay

    I took a look at it and I see you are multiplying the hoursworked number by 24 after subtracting clockin from clockout but what is Csng ? and when would I run this query ? Should I run it every time someone clocks out ? BTW Thanks a ton ! It does function well now !

    Dan

  15. #15
    Join Date
    May 2003
    Posts
    47

    offline

    I have to go offline for a couple hours but thank you very much !

    Dan

Posting Permissions

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