UPDATE VS4TAPInvoiceMB Set TIPMNAmountInRate=round(
(SELECT TIAPExchangeRate FROM VS4TAPInvoice WHERE VS4TAPInvoice.TIAPNo=VS4TAPInvoiceMB.TIPMTIAPNo)*TIPMNetAmount,2)
 WHERE (TIPMNAmountInRate=0 or TIPMNAmountInRate is null)
GO
UPDATE VS4TAPInvoiceMB Set TIPMNAmountInRate=0 WHERE TIPMNAmountInRate is null
GO