Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Problem of dividing in 0

Author  Topic 

liorlankri
Starting Member

17 Posts

Posted - 2005-10-20 : 11:12:55
I have a SQL report that the value of one of the textbox is
=Fields!Type3.Value/Sum(Fields!Type3.Value)

I get an Error (The text NaN) in case that Sum(Fields!Type3.Value)=0

How can I check it before? is it any IF condition??

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-10-20 : 13:43:08
You'll need to use IIF. But what do you want to use when the Sum equals 0?

Tara
Go to Top of Page

liorlankri
Starting Member

17 Posts

Posted - 2005-10-20 : 14:30:52
I want that in that case the valuw will be 0 and iff not it will be equal to
Fields!Type3.Value/Sum(Fields!Type3.Value)

How to write the IFF condition??
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-10-20 : 14:37:27
=IIF(Fields!Type3.Value = 0, 0, Fields!Type3.Value/Sum(Fields!Type3.Value))

Tara
Go to Top of Page
   

- Advertisement -