Good Afternoon. I have two Tables and they are
Table: GeneralInventory
and Table: Receiving
As you can see this formats on Table are most likely you will see in Inventory System, My Table GeneralInventory is the Main Inventory where all Items that you will received will transfer here and that Table is Receiving as what you see in the table Receiving there 2 Data and they are.
Please be focused on the RINo field they are Different right? now here is what I will do and also my Question (I will convert my Question in Step by Step procedure of the Program)
The Program will Select 1(One) Data from Table
ReceivingI will click a button named
Postand the Program will do the Following-Check if the
ItemCodeof the SelectedRINoalready Exist in the TableGeneralInventoryand If theItemCodeis already in there thenReceivedQtyof tableReceivingandQtyof TableGeneralInventorywill sum up or else add the Data.
I hope you get my point but if not I will show you further Example.
In General: If the Data Exist then Sum it Up or Else add the New Data.
I am using this Code.
INSERT INTO GeneralInventory (ItemCode, Qty)
SELECT RE.ItemCode, RE.ReceivedQty
FROM Receiving RE LEFT JOIN
GeneralInventory GI
ON GI.ItemCode = RE.ItemCode AND GI.Qty = RE.ReceivedQty
WHERE RE.RINo = 'Data of RINo'
UPDATE GeneralInventory GI
INNER JOIN receiving RE
ON GI.ItemCode = RE.ItemCode AND GI.Qty = RE.ReceivedQty
SET GI.Qty = GI.Qty + RE.ReceivedQty RE.RINo = 'Data of RINo'
TY for future Help



