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

    Unanswered: Consolidation Query to sum totals together to yield one row

    Desperately need to consolidate data in SQL/Access

    Basically the data is the spend information for many suppliers, I need to churn out just the supplier name along with a sum of their amounts spent/ volume.

    I need to get FROM THIS:

    Company Contract Amount Spent Volume

    Shell Oil Shell891 10 100
    Shell Oil Shell892 20 200
    BP BP0001 50 1
    BP BP0001 100 2


    Company Amount Spent Volume
    Shell Oil 30 300
    BP 150 3


    So I need a query that can add both the amount spent and volume and then remove DISTINCT company name rows. I understand the basics of SQL but sub-queries start to confuse me!

    I would be eternally grateful for any help/ advice/ tips.

    Many, many thanks!


  2. #2
    Join Date
    Jan 2004
    Islamabad, Pakistan
    just use company id and fields to be totals and remove the contract field from there and group by them for company id and sum the totals in your query (I mean just use the company id and the fields you want to total and remove all other irrelevent fields like contract or address etc) and you'll get what you want.

    - Saqib

Posting Permissions

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