error converting expression to float

Who is online?  0 guests and 0 members
Home  »  Forums   »  microsoft business intelligence   »  sql server   » error converting expression to float

error converting expression to float

Topic RSS Feed

Posts under the topic: error converting expression to float

Posted: 4/10/2012

Padawan 378  points  Padawan
  • Joined on: 4/3/2012
  • Posts: 189

hi

 

i m using this expression in my query

 

EXP(sum(log(1+ field/100)))-1) * 100

 

it gives me error like arithmetice overflow error converting expression to data type float.

 

how to solve that


Posted: 4/10/2012

Jedi Master 2811  points  Jedi Master
  • Joined on: 2/19/2010
  • Posts: 406

What are some of the values that this expression returns?

sum(log(1+ field/100)))-1

What is the greatest value it returns?

I suggest you use this expression for some troubleshooting first before adding the EXP and * 100.


Posted: 4/10/2012

Padawan 378  points  Padawan
  • Joined on: 4/3/2012
  • Posts: 189

it seems like both exp and log are return float and sum is return integer ,so if i remove sum,it works fine,

 

but i need sum in my formula

 

what to do


Posted: 4/11/2012

Jedi Knight 1516  points  Jedi Knight
  • Joined on: 1/3/2010
  • Posts: 266

Hi ssrsnew.

Have you tried to replace 100 with 100.0? Something like this:

EXP(sum(log(1+ field/100.0)))-1) * 100

I believe that is your problem.

Let me know if that solved you problem. If so, mark this reply as the answer please.

Best Regards.


Posted: 4/11/2012

Padawan 378  points  Padawan
  • Joined on: 4/3/2012
  • Posts: 189

no , i put 100.o ,my prob is still same


Page 1 of 1 (5 items)