update VS4TTaxTrans set TTxTCustomNo=(select top 1 tinvCustomNo from vs4tinventory 
where vs4tinventory.TInvRefNo3=VS4TTaxTrans.TTxtDocNo and  TInvTInTAlias Like 'LOTIN%')
where ttxttype=0 and (TTxTCustomNo='' or TTxTCustomNo is null)
GO
update VS4TTaxTrans set TTxTCustomNo=(select top 1 tinvCustomNo from vs4tinventory
where vs4tinventory.TInvRefNo3=VS4TTaxTrans.TTxtDocNo and TInvTInTAlias Like 'SALEOUT%')
where ttxttype=1 and (TTxTCustomNo='' or TTxTCustomNo is null)
GO
update VS4TTaxTrans set TTxTCustomDate=(select top 1 tinvCustomDate from vs4tinventory 
where vs4tinventory.TInvRefNo3=VS4TTaxTrans.TTxtDocNo and  TInvTInTAlias Like 'LOTIN%')
where ttxttype=0 and (TTxTCustomNo<>'' or TTxTCustomDate is null)
GO
update VS4TTaxTrans set TTxTCustomDate=(select top 1 tinvCustomDate from vs4tinventory 
where vs4tinventory.TInvRefNo3=VS4TTaxTrans.TTxtDocNo and  TInvTInTAlias Like 'SALEOUT%')
where ttxttype=1 and (TTxTCustomNo<>'' or TTxTCustomDate is null)
GO

