August 3, 2011 at 6:38 am
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
August 3, 2011 at 7:21 am
Change it to real.
August 3, 2011 at 7:50 am
Sorry which part....as i have tried that and i can't seem to get it to work
August 3, 2011 at 8:06 am
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 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy