update vs4tpostranssub set tptscost=(select tpdtlastcost from vs4tproduct where tptstposcode=tpdtcode)
,tptscostamount=tptsquantity*(select tpdtlastcost from vs4tproduct where tptstposcode=tpdtcode)
where (tptscostamount=0 or tptscostamount is null)