You could use custom code and define a VB function that uses
if-then-else-endif.
Alternatively, if you want to use RDL expressions, you can use the IIF
function. Since IIF is a function it will evaluate all arguments before
executing the function. This causes the division by zero. In general, for
the IIF function you would always want to use the following pattern:
=iif( B = 0, 0, A / iif( B = 0, 1, B))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view] "Nat Johnson" <NatJohnson@discussions.microsoft.com> wrote in message
news:5A7A3F4A-5DA5-4950-99F9-D4644D7FAF3D@microsoft.com...
> Oops I thought I could try something like this but it hasn't
> worked.....any
> thoughts???
>
> =if (sum(Fields!JanuaryG5.Value) + sum(Fields!JanuaryL5.Value)) > 0
> then sum(Fields!JanuaryG5.Value) / (sum(Fields!JanuaryG5.Value) +
> sum(Fields!JanuaryL5.Value)) * 100
> else 0)end
>
> "Nat Johnson" wrote:
>
>> Have a table that is requiring a percentage column.
>> No probs there, have it and its working. Problem is ...if the columns in
>> the expression have a "0" value then it shows "NaN". How do I get around
>> this. I want to only show 0.00 in the field.
>>
>> Note that the expression is on the textbox not in the sql query.
>>
>> =sum(Fields!FebruaryG5.Value) / (sum(Fields!FebruaryG5.Value) +
>> sum(Fields!FebruaryL5.Value)) * 100
>>
>> Basically if it returns "NaN" i want to display 0.00.
>>
>>
>>