UPDATE VS4TTaxTrans set TTxTCancelStatus=(SELECT TAPVCancelStatus From VS4TAPVoucher WHERE VS4TAPVoucher.TAPVno=VS4TTaxTrans.TTxTDocNo)
WHERE TTxtSaveFrom='PV' and TTxTCancelStatus=0
GO
UPDATE VS4TTaxTrans set TTxTCancelStatus=(SELECT TRVHCancelStatus From VS4TARVoucher WHERE VS4TARVoucher.TRVHNo=VS4TTaxTrans.TTxTDocNo)
WHERE TTxtSaveFrom='RV' and TTxTCancelStatus=0
GO
UPDATE VS4TTaxTrans set TTxTCancelStatus=0 WHERE TTxTCancelStatus is null
GO