UPDATE VS4Tinventory Set TInvTotalAInput=(SELECT SUM(abs(TInMAmount)) FROM VS4TinventoryMB WHERE VS4Tinventory.tinvno=VS4TinventoryMB.tinmtinvno AND VS4TinventoryMB.TInMAmouQuantity<0
and VS4TinventoryMB.TInMAmount is not null)
GO