Hi,
I need some help with writing an update query in Access which will update the stock column of the table below. This is designed to determine where the stock is used and a tricky one to describe....
Here is a sample of the data
ProdID In_Stock PurchaseOrderQty PurchaseOrderNo Stock
Prod123 650 150 PO_ABC123 150
Prod123 650 300 PO_ABC124 300
Prod123 650 150 PO_ABC125 150
Prod123 650 450 PO_ABC126 50
Prod123 650 150 PO_ABC127 0
Prod123 650 150 PO_ABC128 0
Here is an explanation of how the data in the stock column is derived:
Total 650 in stock.
150 come in on PO_ABC123 so we have 150 of these in stock
300 come in on PO_ABC124 so we have 300 of these in stock (450 total = 150 + 300)
150 come in on PO_ABC125 so we have 150 of these in stock (600 total = 150 + 300 + 150)
450 come in on PO_ABC126 so we have 50 of these in stock (650 – 600)
Could someone assist with a suitable update query to fill in the stock column for each record please?
Many thanks
All help is greatly appreciated
Kind regards
Ota
I need some help with writing an update query in Access which will update the stock column of the table below. This is designed to determine where the stock is used and a tricky one to describe....
Here is a sample of the data
ProdID In_Stock PurchaseOrderQty PurchaseOrderNo Stock
Prod123 650 150 PO_ABC123 150
Prod123 650 300 PO_ABC124 300
Prod123 650 150 PO_ABC125 150
Prod123 650 450 PO_ABC126 50
Prod123 650 150 PO_ABC127 0
Prod123 650 150 PO_ABC128 0
Here is an explanation of how the data in the stock column is derived:
Total 650 in stock.
150 come in on PO_ABC123 so we have 150 of these in stock
300 come in on PO_ABC124 so we have 300 of these in stock (450 total = 150 + 300)
150 come in on PO_ABC125 so we have 150 of these in stock (600 total = 150 + 300 + 150)
450 come in on PO_ABC126 so we have 50 of these in stock (650 – 600)
Could someone assist with a suitable update query to fill in the stock column for each record please?
Many thanks
All help is greatly appreciated
Kind regards
Ota