Update VS4TPurPriceListMB Set TPUMTCurCode1='THB' WHERE TPUMTCurCode1 is NULL or TPUMTCurCode1 ='' or TPUMTCurCode1 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode2='THB' WHERE TPUMTCurCode2 is NULL or TPUMTCurCode2 ='' or TPUMTCurCode2 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode3='THB' WHERE TPUMTCurCode3 is NULL or TPUMTCurCode3 ='' or TPUMTCurCode3 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode4='THB' WHERE TPUMTCurCode4 is NULL or TPUMTCurCode4 ='' or TPUMTCurCode4 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode5='THB' WHERE TPUMTCurCode5 is NULL or TPUMTCurCode5 ='' or TPUMTCurCode5 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode6='THB' WHERE TPUMTCurCode6 is NULL or TPUMTCurCode6 ='' or TPUMTCurCode6 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode7='THB' WHERE TPUMTCurCode7 is NULL or TPUMTCurCode7 ='' or TPUMTCurCode7 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode8='THB' WHERE TPUMTCurCode8 is NULL or TPUMTCurCode8 ='' or TPUMTCurCode8 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode9='THB' WHERE TPUMTCurCode9 is NULL or TPUMTCurCode9 ='' or TPUMTCurCode9 ='BHT' 
GO
Update VS4TPurPriceListMB Set TPUMTCurCode10='THB' WHERE TPUMTCurCode10 is NULL or TPUMTCurCode10 ='' or TPUMTCurCode10 ='BHT' 
GO

Update VS4TProductStat Set TPMSLastPTCurCode=(SELECT TOP 1 TPUMTCurCode1 FROM 
VS4TPurPriceList INNER JOIN VS4TPurPriceListMB ON VS4TPurPriceList.TPUPNo = VS4TPurPriceListMB.TPUMTPUPNo
WHERE (((VS4TPurPriceList.TPUPApproveStatus)=1) AND ((VS4TPurPriceList.TPUPCancelStatus)=0))
AND VS4TPurPriceListMB.TPUMTPdtCode=VS4TProductStat.TPMSTPdtCode 
ORDER BY VS4TPurPriceList.TPUPDate DESC)
WHERE TPMSLastPTCurCode is NULL or TPMSLastPTCurCode =''
GO

Update VS4TProductStat Set TPMSLastPTCurCode='THB' WHERE TPMSLastPTCurCode is NULL or TPMSLastPTCurCode =''
GO
