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