Hi I run the same query against two DB, one is the publisher and other is the subscriber.The two DB should be identical but [b]the subscriber raise the "Divide By Zero" error while the publisher return the correct result.[b][/b][/b]Of course.... NONE OF THE RETURNED ROWS HAVE A ZERO in the relevant fields!!!:w00t: This is the query SELECT CASE WHEN BAL_IN.FK_CURR = 'EUR' then 1.0 -- If the currency is EURO the exchange rate is one ELSE -- Otherwise calculate it. BAL_IN.LEDGER_BAL_ORG_AMT/ BAL_IN.AC_FUNC_AMT -- [b]HERE RAISE THE DIVIDE BY ZERO ERROR[/b] END AS Exchange_Rate , CASE WHEN BAL_IN.FK_CURR = 'EUR' THEN DET_IN.DTL_AMT ELSE DET_IN.DTL_AMT/(BAL_IN.LEDGER_BAL_ORG_AMT/BAL_IN.AC_FUNC_AMT) -- [b]This statement is similar but DO NOT Raise the Error(!!?) [/b] END AS Exchanged_amount, BAL_IN.AC_FUNC_AMT , BAL_IN.LEDGER_BAL_ORG_AMT, DET_IN.DTL_AMT, FROM SICSNTPC.AC_LEDGER_DETAIL AS DET_IN , SICSNTPC.AC_LEDGER_BALANCE AS BAL_IN WHERE Where conditions......I've found a kind of bypass using this statement WHEN (ABS(BAL_IN.AC_FUNC_AMT)) <> 0 then ABS(BAL_IN.LEDGER_BAL_ORG_AMT)/ ABS(BAL_IN.AC_FUNC_AMT)The problem has appeared lately but I can't imagine the origin of that. Someone has ideas of what could be the reason of this disconcerting behaviour ? Many thanks for the help :-) Giuliano
↧