Results 1 to 13 of 13
  1. #1
    CBRRider1's Avatar
    CBRRider1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    7

    Report Calculations incorrect.....why?


    Hello all! I'm new to the forum and need some help. I've created a report from a query that has 2 calculated fields in it. I have the report totals working, but I can't get the average to work. The number that comes out is not what the calculator tells me. The report that is names MONTHLY at the end is the one I'm working on. Can anyone help me out and explain what I did wrong, or how it's coming up with the number it shows?

    Thanks,
    CBRRider1

    MeterDB.zip

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Why are you using DateAdd to calculate an additional day for the End Date parameter? BETWEEN AND is inclusive for the range ends.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CBRRider1's Avatar
    CBRRider1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    7
    I believe we used that same code for another DB where we wanted the date range to include the days that are entered. 1/1/14 - 2/15/14 would have to 11:59pm. If there is a better way, please let me know. I'm not an expert with Access, but I feel I know a good amount. If it includes it in the 2010 version, that's great, but I know we had an older Access version that needed to have it in there to have reports show the way we wanted. The person that does the reports wants to put in the 1st and last day of the month when viewing the reports (and we aim to please).

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    If I enter 1/30/2014 to 1/30/2014 what I get is 1/30/2014 to 1/31/2014 records.

    What I am not understanding is the variance in the average calculation.

    Since you have the average calc in the query for each record, just do a Sum on that field (meter_avg) in the report footers.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    CBRRider1's Avatar
    CBRRider1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    7
    What he wants is an average for each person for the month and also the average for the month. Total images for each person divided by the active hours. Then the total images for the month divided by the total active hours. You can't sum the average and get the same number. Just doing the math the way it is now doesn't come up right. And I can't figure out why the one person at the bottom comes up with a DIV error when it should be dividing by .5.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    What is image - each record?

    Still don't understand need to add 1 day to EndDate in the query. The VBA procedure that sets form Filter property does not.

    If you want monthly summary in the report then maybe add a month/year group. Or is the Monthly report supposed to be filtered to a single month?

    I don't see DIV error on MONTHLY report. The DIV error I see is on the Daily report and it is because dividing by 0 ActiveHours.

    Sorry about the Sum() suggestion - didn't think that one through.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    CBRRider1's Avatar
    CBRRider1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    7
    Nevermind the date problem, I can fix that later. What the end user is tracking is images printed on a production color printer. Each user enters their start and end number along with active and downtime. The MONTHLY report I made is tied to a query that has the total images printed as a calculated field from meter_end - meter_start. Also meter_avg is calculated in the query to be meter_total / active_hours. The dates I used are just so we are looking at the same thing. 1/1/14 - 2/15/14. At the bottom (Sinckler) shows a DIV error when I look at it. Images are 1860 for 0.5 active hours. That should result in a normal number. Just doing the math on the grand total line, (213,594 / 78.25), the good old calculator tells me it's 2729.64. The report says 2738. It seems to be the same for most of them. Amodeo is 85,774 / 25.75. Calc = 3331.03. Report says 3299. How can that be?

    As for the supervisor doing the reports, he wants to be able to see daily and monthly totals that include the average per shift and average for the whole month. Let me know if I need to explain anything else. I think I got it all in there.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Now I see the DIV error.

    I deleted the expression from the oper footer textbox and retyped: =[txt2]/[Text41]

    No more DIV error. Weird
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    CBRRider1's Avatar
    CBRRider1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    7
    Still can't figure out why. And why the division is incorrect. Any ideas? Should I move this to another forum/area?

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    I filtered the report so it returned only one record (Benenati, 1/30/2014).

    The calcs agree.

    I retyped the formula in the report footer textbox and now that calc is also correct when all records (except OP_Maint) are retrieved.

    I've never encountered a textbox ControlSource expression to be corrupted like that, but that is the only explanation I can come up with for both.

    Moving the thread won't help. If anyone else had an idea, they would have posted.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    CBRRider1's Avatar
    CBRRider1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    7
    Can you send me what you have now? My totals are still wrong. If you at least got that, I'll take it.

    Thanks for all your help.

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Would have been better if you could have fixed yourself but since this is such a weird issue, here it is. I hope it gives you the results I see.

    When opening report, just enter past the date popups. I modified the query for default values.
    Attached Files Attached Files
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    CBRRider1's Avatar
    CBRRider1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    7
    Mark this as solved. I think changing the date in the query fixed the math. Not sure why exactly, but I'll take it. All the calcs look good. Thanks for your help.

    CBRRider1

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Formatting calculations on a report
    By Nashskye13 in forum Reports
    Replies: 1
    Last Post: 12-12-2012, 03:52 PM
  2. Incorrect Calculations in Report
    By Bridiewms in forum Reports
    Replies: 6
    Last Post: 01-30-2012, 10:28 AM
  3. Incorrect sorting in report.
    By jonesy29847 in forum Reports
    Replies: 2
    Last Post: 06-16-2010, 05:56 PM
  4. Creating a report with calculations
    By Normantom in forum Queries
    Replies: 1
    Last Post: 05-07-2010, 06:29 AM
  5. Incorrect summation in report footer
    By wizard_chef in forum Reports
    Replies: 2
    Last Post: 12-07-2009, 06:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums