Thursday, March 29, 2012

error when using IIF with sum()

I have a field I need to have a count for, which is fine, but if that count is equal to nothing I don't want anything to print out in that textbox.

It works if the count is equal to nothing BUT if the count has a value I get an error message.

My logis is
if count = "" then print nothin else print the count

=iif( Sum(Fields!delStatusCount.Value, "dsDelStatusCount") = "", "", "DEL = " & Sum(Fields!delStatusCount.Value, "dsDelStatusCount"))

Thanks

The function sum will return a value. So you can not compare with a string ("") try to replace the string of just =iif(sum(x), x, "").

|||

You can also explicitly state it like:

=IIF(ISEMPTY(sum(x)), x, "")

No comments:

Post a Comment