Divide by Zero exception with Formula
Posted: Wed Mar 25, 2009 8:31 pm
Hi,
I'm using a text field for calculation. Somehow I'm receiving a divide by zero exception
As a test, this works fine:
{IIF(DS_Forecast.DS_SG35_Forecast.MN_CgAvail== 0,0,(1)/DS_Forecast.DS_SG35_Forecast.MN_CgAvail )}
However, when i subsitute (1) with (Sum(Data1,DS_Forecast.DS_SG35_Forecast.FG_Inv)) into
{IIF(DS_Forecast.DS_SG35_Forecast.MN_CgAvail== 0,0,(Sum(Data1,DS_Forecast.DS_SG35_Forecast.FG_Inv))/DS_Forecast.DS_SG35_Forecast.MN_CgAvail )}
It throws a "Divide by zero exception
Please advise on any workarounds
Also, I will expect the calculation not to happen at all since the divisor is a 0, it should just return a 0. yes?
I'm using a text field for calculation. Somehow I'm receiving a divide by zero exception
As a test, this works fine:
{IIF(DS_Forecast.DS_SG35_Forecast.MN_CgAvail== 0,0,(1)/DS_Forecast.DS_SG35_Forecast.MN_CgAvail )}
However, when i subsitute (1) with (Sum(Data1,DS_Forecast.DS_SG35_Forecast.FG_Inv)) into
{IIF(DS_Forecast.DS_SG35_Forecast.MN_CgAvail== 0,0,(Sum(Data1,DS_Forecast.DS_SG35_Forecast.FG_Inv))/DS_Forecast.DS_SG35_Forecast.MN_CgAvail )}
It throws a "Divide by zero exception
Please advise on any workarounds
Also, I will expect the calculation not to happen at all since the divisor is a 0, it should just return a 0. yes?