Good afternoon all,
I am working on my DB and have 2 tables that I want to work with but I just cant work out the correct syntax for an expression…
Table1: TransactionLogISSUE – this contains the following fields (Amongst others that are not relevant for this question):
· PartID
· PartDescription
· Issuedfrom (which relates to warehouse location – WHLocatID)
· TransactionQty
Table2: Inventory – this contains the following fields (Amongst others that are not relevant for this question):
· PartID
· PartDescription
· WHLocatID (warehouse location)
· OpeningStockQuantity (the initial stock level when the part was entered in the system)
· LocationQuantity (the current stocking level: which is the opening stock level, minus any “issues”)
The log is simply an itemised history of “issues” generated from a form which all works perfectly; however I need to have the LocationQuantity field in the Inventory table calculated based on the OpeningStockQuantity Minus the sum total of all TransactionQty.
For point of clarity – “Issue” is when an item is removed from the warehouse.
For Example…
· Part A “opening” stock = 11 in WHLocatID BB1 and 3 from CF3 (Total stock therefore is 14)
· An Issue of 2 x Part A is made from location BB1
· Therefore we should be left with 9 in BB1 and 3 in CF3 – these are the figures that the LocationQuantity field should show in the Inventory table.
I just cant work out what the syntax should be for this calculation.
As always – any help gratefully received!
Chris
I am working on my DB and have 2 tables that I want to work with but I just cant work out the correct syntax for an expression…
Table1: TransactionLogISSUE – this contains the following fields (Amongst others that are not relevant for this question):
· PartID
· PartDescription
· Issuedfrom (which relates to warehouse location – WHLocatID)
· TransactionQty
Table2: Inventory – this contains the following fields (Amongst others that are not relevant for this question):
· PartID
· PartDescription
· WHLocatID (warehouse location)
· OpeningStockQuantity (the initial stock level when the part was entered in the system)
· LocationQuantity (the current stocking level: which is the opening stock level, minus any “issues”)
The log is simply an itemised history of “issues” generated from a form which all works perfectly; however I need to have the LocationQuantity field in the Inventory table calculated based on the OpeningStockQuantity Minus the sum total of all TransactionQty.
For point of clarity – “Issue” is when an item is removed from the warehouse.
For Example…
· Part A “opening” stock = 11 in WHLocatID BB1 and 3 from CF3 (Total stock therefore is 14)
· An Issue of 2 x Part A is made from location BB1
· Therefore we should be left with 9 in BB1 and 3 in CF3 – these are the figures that the LocationQuantity field should show in the Inventory table.
I just cant work out what the syntax should be for this calculation.
As always – any help gratefully received!
Chris