update vs4tinventorymb set tinmamount=tinmamouquantity*(select timcunitcost from vs4tinventorylot where timctpdtcode=tinmtpdtcode and timclotno=tinmlotno
and timclotdate=tinmlotdate and timccustom1=tinmcustom1 and timcserialno=tinmserialno)
where tinmtintalias='STOCKADJUST'