Results 1 to 3 of 3

Thread: [RESOLVED] SQL/Access Help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Resolved [RESOLVED] SQL/Access Help

    I have a spreadsheet of over 3,000 different products showing customer number, customer name, product numbers, product name, and quantity. I am trying to get the total number of each product without adding them one by one. I have imported the spreadsheet in Access 2003 thinking I could create a query that would give me the information, however, it ends up giving me duplicate information. I can get the correct information if I use the following:

    SELECT Sum([Sheet 1].[Qty Shipped SUM]) AS QTY
    FROM [Sheet 1]
    WHERE ((([Sheet 1].[Product Number])="011997"));

    However, I would have to do this over 3,000 times to get all the information. I was wondering if anyone knows another way to approach this so that I can get the sum of the quantities for each product without trying to get them one by one. Thank you in advance!

    Nenio foriras ĝis ĝi havas instru ni kiu ni devas scii.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: SQL/Access Help

    Use a Group By, eg:
    Code:
    SELECT [Sheet 1].[Product Number], Sum([Sheet 1].[Qty Shipped SUM]) AS QTY
    FROM [Sheet 1]
    Group By [Sheet 1].[Product Number]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Re: SQL/Access Help

    Thanks, that saved me a TON of time!! Thanks again!

Posting Permissions

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



Click Here to Expand Forum to Full Width