I have a query that pulls data from 2 tables: Open_Items_List & Jobs_Parts.
Open items is a table of all current PO's, with part numbers and quantity ordered. There may be duplicates in this table, so quantity ordered must be summed.
Jobs_Parts is a table of the parts required for every active job in production.
The final query must have the following fields:
Qty_Needed : number of that part required: Comes from jobs_Parts
Qty_Ready : number of those parts currently dedicated to that job: manually input
Qty_still_needed: Qty_Needed - Qty_Ready (calculated field in jobs_Parts)
Qty_On_Hand: the sum of all Qty_Ready
Qty_On_Order: the sum of quantity ordered in Open_Items
Qty_Short: (((sum of all Qty_Needed) - sum of all Qty_on_Hand) - Sum of qty_on_order)
These sums should be specific to each part number, and show up for each item in Jobs_Parts.
I started with trying to do it all in one step, but have now simplified to just getting part data.
for better reference:
The excel sheet I am attempting to duplicate:

The first query I have written to get data for each part (returning wrong values):
Code:
SELECT Open_Items_List.Part_No, Open_Items_List.Part_Description, Sum(Open_Items_List.Qty_Ordered) AS Qty_On_Order, Sum(Jobs_Parts.Qty_Ready) AS Qty_On_Hand, Sum(Jobs_Parts.Qty_Still_Needed) AS Qty_Short
FROM Open_Items_List
INNER JOIN Jobs_Parts ON Open_Items_List.Part_No = Jobs_Parts.Part_No
GROUP BY Open_Items_List.Part_No, Open_Items_List.Part_Description;