O
Omar K
Hi, I am doing a stock database and I have to update the quantity of a
stock item when the stock item either goes out or comes into the
warehouse. I am using the SQL part of the database wizard to write my
update code.
This is what it looks like:
UPDATE totalQty
SET Qty = ((SELECT Qty FROM StockFlow WHERE StockCode =
‘::StockCode::') + (SELECT Qty FROM totalQty WHERE StockCode =
‘::StockCode::'))
WHERE StockCode = ‘::StockCode::'
----
it is a '+' sign because i am testing the code first, so this would be
for incoming parts only.
I get an error - maybe because the calculation involves the same
column item that needs to be updated. Is this correct or is it
something else I am doing wrong? If what I think is true, what other
way is there correcting it other than creating a duplicate column of
the quantites ?
stock item when the stock item either goes out or comes into the
warehouse. I am using the SQL part of the database wizard to write my
update code.
This is what it looks like:
UPDATE totalQty
SET Qty = ((SELECT Qty FROM StockFlow WHERE StockCode =
‘::StockCode::') + (SELECT Qty FROM totalQty WHERE StockCode =
‘::StockCode::'))
WHERE StockCode = ‘::StockCode::'
----
it is a '+' sign because i am testing the code first, so this would be
for incoming parts only.
I get an error - maybe because the calculation involves the same
column item that needs to be updated. Is this correct or is it
something else I am doing wrong? If what I think is true, what other
way is there correcting it other than creating a duplicate column of
the quantites ?