How to combine fields in Access 2010 based on 2 equal fields?


  1. Posts : 1
    Windows 7, 64 bit
       #1

    How to combine fields in Access 2010 based on 2 equal fields?


    Hi all,

    I知 really in need of some help from some Access experts! I知 a newbie to Access, but I got myself busy with quite a big project... I知 trying to map out the product supply to shops in the whole country. I致e come quite far for a starter, but I keep having 3 questions, it would be great if you could help me with this!

    I have, amongst other tables, two tables called Stock_counted and Reported_quantity.

    The table Stock_counted has the following fields:
    - Shop_number
    - Product_code
    - Quantity_counted

    The table Reported_quantity has the following fields:
    - Shop_number
    - Product_code
    - Quantity_in
    - Quantity_lost_or_returned
    - Quantity_out

    1. What I would like to do is to make it one table based on Shop_number AND Product_code. So in one record I would like to have Shop_number, Product_code, Quantity_in, Quantity_lost_or_returned, Quantity_out and Quantity_counted. How do I do this, making sure that the quantities end up behind the right product and shop? It is possible that some shops don稚 have all items, while other shops might not have all products reported, or both. On top of that, I have another table with a price for each product, which needs to be related to it as well.

    2. It happens that some products are found more than once in one specific shop and therefore appear more than once in the table, with the same shop number and product code. How do I automatically SUM these quantities, so that this product only shows up once per shop?

    3. Finally, I have some products which are the same but have slightly different descriptions and therefore different product codes. Is there a way to link them all under one (existing, one of the descriptions) code without having the other codes showing up anymore?

    I would really appreciate it if anyone can help me with this, I知 desperate!!

    Thank you so much,

    Josephine
    Access 2010 user
      My Computer


  2. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #2

    Josephine87 said:

    2. It happens that some products are found more than once in one specific shop and therefore appear more than once in the table, with the same shop number and product code. How do I automatically SUM these quantities, so that this product only shows up once per shop?
    select shop, product, sum(quantityfield1), sum(quantityfield2)
    from sometable
    group by shop, product
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

ゥ Designer Media Ltd
All times are GMT -5. The time now is 23:28.
Find Us