That means there are exchange rates that are zero. What do you want to do in those cases? For example, you could make them null - like so:INSERT INTO Calamos.ExchangeRates (CMONREF,CODMON,TCOURS,DCTA,DCTA_TCHG)SELECT Distinct 'USD',ShareCurrency, ROUND(1/NULLIF(ExchanegRate,0),6),Date,DateFROM generic.DailyPriceWHERE ExchanegRate IS NOT NULL
Or you can choose to exclude such rows, like this:INSERT INTO Calamos.ExchangeRates (CMONREF,CODMON,TCOURS,DCTA,DCTA_TCHG)SELECT Distinct 'USD',ShareCurrency, ROUND(1/ExchanegRate,6),Date,DateFROM generic.DailyPriceWHERE ExchanegRate IS NOT NULL OR ExchangeRate = 0