error message - An invalid floating point operation occurred

  • Hi,

    I get this error message when i run the following code;

    ERROR:

    Msg 3623, Level 16, State 1, Line 12

    An invalid floating point operation occurred.

    CODE

    ((Cast(Sum(DSR_Calcs1.Calc1) / sum(DSR_Calcs1.REF) * @Multiplier as numeric(25,15)))/@Multiplier+

    SQRT((CAST(Sum(DSR_Calcs1.Calc2)as numeric(25,15)))/Power((CAST(Sum(DSR_Calcs1.REF)as numeric(25,15))),2)/(CAST(Sum(DSR_Calcs1.Calc2)as numeric(25,15)))*

    (Case When ((CAST(Sum(DSR_Calcs1.Obs)as numeric(25,15)))=0) Then 0 Else

    case When ((CAST(Sum(DSR_Calcs1.Obs)as numeric(25,15)))<389)then [CHIINV/2]

    ELSE (CAST(Sum(DSR_Calcs1.Obs)as numeric(25,15)))*POWER((1-1/

    (9*(CAST(Sum(DSR_Calcs1.Obs)as numeric(25,15))))-1.95996398454005/3/SQRT((CAST(Sum(DSR_Calcs1.Obs)as numeric(25,15))))),3)end end)

    -(CAST(Sum(DSR_Calcs1.Obs)as numeric(25,15)))

    ))*@Multiplier

    AS Final

    How can avoid this, is ther a simple answer. I narrowed i down to the face that the error is triggered by the following part of the code;

    SQRT((CAST(Sum(DSR_Calcs1.Calc2)as numeric(25,15)))/Power((CAST(Sum(DSR_Calcs1.REF)as numeric(25,15))),2)/(CAST(Sum(DSR_Calcs1.Calc2)as numeric(25,15)))

    Thanks in advance

  • Change it to real.

    Alex S
  • Sorry which part....as i have tried that and i can't seem to get it to work

  • Coment all the columns but one then run.

    Uncomment untill you it the error. Then it'll be much easier to spot.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply