UPDATE VS4TTaxTrans Set TTxTClientTaxNo=(SELECT TARNTaxNo FROM VS4TAR WHERE VS4TAR.TARNCode=VS4TTaxTrans.TTxTClientCode) WHERE (TTxTClientTaxNo='' OR TTxTClientTaxNo is NULL) AND (TTXTTYPE=1 OR TTXTTYPE=3)
GO
UPDATE VS4TTaxTrans Set TTxTClientTaxNo=(SELECT TAPNTaxNo FROM VS4TAP WHERE VS4TAP.TAPNCode=VS4TTaxTrans.TTxTClientCode) WHERE (TTxTClientTaxNo='' OR TTxTClientTaxNo is NULL) AND (TTXTTYPE=0 OR TTXTTYPE=2 OR TTXTTYPE=5)
GO
UPDATE VS4TTaxTrans Set TTxTClientTaxNo=(SELECT TEmpCitizenNo FROM VS4TEmployee WHERE VS4TEmployee.tempcode=VS4TTaxTrans.TTxTClientCode) WHERE (TTxTClientTaxNo='' OR TTxTClientTaxNo is NULL) AND (TTXTTYPE=4)
GO