Results 1 to 6 of 6
  1. #1
    Sara Bellum is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4

    Post Building a Query that can extract data and sum

    Hello
    I have a database that is comprised of raw material and finished material. I have a table that contains the information regarding the raw material, (raw material ID, supply, manufacturer, cost etc). I have multiple tables that contains the information of raw material that was used in the finished material (finished ID, raw material ID, amount used, etc). Multiple raw materials are used in the finished material. Ultimately I would like to create a report that gathers all of the raw materials that were used to make a finished material. I have created a query for each raw material that is used to come up with the price for each product. Cost of raw material multiplied by the volume used but this will give me the total for each type of material used and not an overall cost. How do I come up with the overall cost to product finished material (say like finished product Y in the example)? I have tried creating a basic query of one raw material to the finished product but I get the same value repeated over multiple rows in the query table. Please any help would be greatly appreciated.

    Example
    Raw Material A table
    Raw Material ID Supply Manufacturer Cost
    1 Shampoo Acme 1.00
    2 Lotion SomeManufacturer 2.00


    Raw Material A Data table


    Raw Material ID Finished Product Volume
    1 X 10
    1 Y 20

    Raw Material B table
    Raw Material ID Supply Manufacturer Cost
    B Bottles Waterford 3.00
    C Bottles Waterford 3.50

    Raw Material B Data table
    Raw Material ID Finished Product Volume Used
    B X 10
    B Y 10
    C Y 20


    Finished Product table
    Finished Product ID Product
    X Shampoo in bottles
    Y Lotion in bottles

    Thanks,

    SB

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I recommend you work through this tutorial to help get you database structured.
    http://www.rogersaccesslibrary.com/T...lationship.zip

  3. #3
    Sara Bellum is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4
    Click image for larger version. 

Name:	access screen shot.jpg 
Views:	9 
Size:	147.4 KB 
ID:	11567

    I hope this screen shot will clarify what I am trying to accomplish. The bottle_cost_q works how it is designed however now I am wanting sum the bottle cost (BtlCost expression) for one final product (Product_Lot_No)

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Review the Sigma --- Totals query
    Attached Thumbnails Attached Thumbnails BottleQuery.jpg  

  5. #5
    Sara Bellum is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4
    I understand that I can apply an advanced filter and then sum using the sigma. I have multiple types of supplies that make up the final. I may have another series of supply tables similar to bottles but it will be for labels. Now, how can I take the the sum of each type of supply for a finished product and apply it to a report? I want the report for finished product to have the sum from bottle query and label query, etc.

    Thanks...

  6. #6
    Sara Bellum is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4
    Figured it out. - don't know why I had such a hang up on this one.

    SELECT Final_Product_Info.Product_Lot_No, Bottle_Data.Bottle_ID, Bottle_Data.Cs_Used, Bottle_Price.Cs_Cost, [Bottle_Data]![Cs_Used]*[Bottle_Price]![Cs_Cost] AS BtlCost
    FROM (Bottle_Info INNER JOIN (Bottle_Price INNER JOIN Bottle_Data ON Bottle_Price.Bottle_ID = Bottle_Data.Bottle_ID) ON Bottle_Info.Bottle_No = Bottle_Price.Bottle_No) INNER JOIN Final_Product_Info ON Bottle_Data.Product_Lot_No = Final_Product_Info.Product_Lot_No;

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

Similar Threads

  1. extract data from Access
    By sameerkadoo in forum Access
    Replies: 3
    Last Post: 06-06-2012, 12:15 PM
  2. Building double data entry database
    By Hyunjee in forum Programming
    Replies: 5
    Last Post: 12-13-2011, 10:40 AM
  3. Replies: 13
    Last Post: 10-26-2011, 03:49 AM
  4. Extract Text Data
    By tmcrouse in forum Queries
    Replies: 5
    Last Post: 05-25-2010, 11:34 AM
  5. Replies: 3
    Last Post: 05-13-2010, 08:18 PM

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