SQL Server seems like it would be important enough to be mostly bug-free, but I came across what I think it a rather major flaw in the reporting services.
I tried to use this function to set a field.
=IIf(IsNumeric(Fields!Data.Value), CDbl(Fields!Data.Value), Fields!Data.Value)
Simple, right? If the value is a number, then turn it into a number so I can use numeric formatting methods on it.
If it's not a number, then just leave it alone and display it.
Does it work? No. It fails because SQL is too stupid to ignore the statement that should only be invoked if the condition is met.
If the data is not numeric, I get an error because SQL tries to do the CDbl conversion anyway.
Here is my solution:
=IIf(IsNumeric(Fields!Data.Value), CDbl(IIf(IsNumeric(Fields!Data.Value), Fields!Data.Value, "0"), Fields!Data.Value)
Clever? Maybe. It certainly illustrates how stupid SQL is being.
Now where's Bill???