update  vs4tpostranssub set tptscost=(select TPdtAverageCost from vs4tproduct where tptstposcode=tpdtcode) where tptscost=0 or tptscost is null

update  vs4tpostranssub set tptscostamount=tptscost*TPTSQuantity where tptscostamount=0 or tptscostamount is null

update  vs4tpostrans set tptacosttotal=(select sum(tptscostamount) from vs4tpostranssub where tptstptano=tptano)

