Results 1 to 6 of 6
  1. #1
    nick243 is offline Competent Performer
    Windows 7 64bit Access 2002
    Join Date
    May 2016
    Posts
    185

    Calculations on a report/query

    So I have a report where I have purchase orders a from vendors by a sequence. My first thing to do is add up all vendor po's lbs in that sequence number then run a vba code that gives me the cost based on lbs. My problem is when I want to divide that cost by the lbs evenly on each po in that sequence then add that to single po cost at the end of the row. Here is an example of my report in design mode. My example of the design view picture is not correct exactly. I have created a query that does all the calculations in the container id portion I just don't know how to divide that cost up between the po's and add that to the costs at the end of the row. Any help would be appreciated.



    Thanks,
    Nick


    Click image for larger version. 

Name:	Report.png 
Views:	18 
Size:	38.8 KB 
ID:	29094Click image for larger version. 

Name:	ReportView.png 
Views:	18 
Size:	30.3 KB 
ID:	29095

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Use queries to do all the calculations prior to creating the report. That way you can check your data before trying to display it. For instance, create one query to calculate the total cost, then bring in that query to evenly distribute the total across all records.

  3. #3
    nick243 is offline Competent Performer
    Windows 7 64bit Access 2002
    Join Date
    May 2016
    Posts
    185
    That's the way I am thinking, I guess I am confused about how to evenly distribute the total that I have to the singular level from the total. Is there any examples out there? I'm not sure how to start a query that can distribute a total number back to the singular PO evenly based on weight.

    Thank You,
    Nick

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You need to figure out the mathematical formula prior to putting it into a query. I use Excel for this purpose, get the formula correct, then translate it into query-speak. It would be something like taking the total and using each weight as a ratio/percent of the total.

  5. #5
    nick243 is offline Competent Performer
    Windows 7 64bit Access 2002
    Join Date
    May 2016
    Posts
    185
    The calculation I came up with is ("Weight of the po"/Total Weight for the Sequence)*"Total Cost" This worked out for me on the report side. I just now need to put this in query speak.

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The weight of the po will come from the table.
    The Total Weight will come from a separate query linked in to this one.
    Not sure where the Total Cost comes from but it seems it would also be a separate query, or if the same grouping can be in the total weight query.

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

Similar Threads

  1. Replies: 32
    Last Post: 03-01-2015, 12:01 PM
  2. Report Calculations incorrect.....why?
    By CBRRider1 in forum Reports
    Replies: 12
    Last Post: 03-08-2014, 12:15 AM
  3. Formatting calculations on a report
    By Nashskye13 in forum Reports
    Replies: 1
    Last Post: 12-12-2012, 03:52 PM
  4. Incorrect Calculations in Report
    By Bridiewms in forum Reports
    Replies: 6
    Last Post: 01-30-2012, 10:28 AM
  5. Creating a report with calculations
    By Normantom in forum Queries
    Replies: 1
    Last Post: 05-07-2010, 06:29 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