update VS4TTaxTrans set TTxTCurrency=(select tivotcurcode from vs4tarinvoice 
where vs4tarinvoice.tivono=VS4TTaxTrans.TTxtDocNo) where TTxTType=1
GO
update VS4TTaxTrans set TTxTCurrency=(select tiaptcurcode from vs4tapinvoice 
where vs4tapinvoice.tiapno=VS4TTaxTrans.TTxtDocNo) where TTxTType=0
GO
update VS4TTaxTrans set TTxTExchangeRate=(select tivoExchangeRate from vs4tarinvoice 
where vs4tarinvoice.tivono=VS4TTaxTrans.TTxtDocNo) where TTxTType=1
GO
update VS4TTaxTrans set TTxTExchangeRate=(select tiapExchangeRate from vs4tapinvoice 
where vs4tapinvoice.tiapno=VS4TTaxTrans.TTxtDocNo) where TTxTType=0
GO
update VS4TTaxTrans set TTxTTotalFOB=(select tivoTotalFOB from vs4tarinvoice 
where vs4tarinvoice.tivono=VS4TTaxTrans.TTxtDocNo) where TTxTType=1
GO
update VS4TTaxTrans set TTxTTotalFOB=(select tiapTotalFOB from vs4tapinvoice 
where vs4tapinvoice.tiapno=VS4TTaxTrans.TTxtDocNo) where TTxTType=0
GO