I have the following stored prodedure below.
I have columns called qty1, qty2, qty3, qty4 in tblZPLUSales and I want a way to add all these values on a row together and then minus this from my currentstock column in tblStock
Qty1 = 10
Qty2 = 2
Qty3 = 30
Qty4 = 11
A total: 53
Now update my tblStock taking away the 53.
UPDATE p set p.currentstock=p.currentstock-u.qty1 FROM tblStock p join tblZPLUSales u on p.id=u.id