Monday, February 13, 2012

Aren't IIF statements supposed to be straight forward...

Hi

IIF statements are simple and I have had them work on other reports. But for the first time I'm using "Like" operator for string comparison and I can't get this to work!

For ease, my boolean condition is in blue color, and the green color field value is to be returned incase the condition is TRUE and the red color field value is to be returned incase the condition is FALSE.

=IIF(((First(Fields!well_type.Value, "WellAttributes")Like First(Fields!code.Value, "LookUpCodeTblAttributes"))And (First(Fields!code_type.Value, "LookUpCodeTblAttributes")Like "well type")),First(Fields!description.Value, "LookUpCodeTblAttributes"),"N/A")

Instead, its giving me the following error:

[rsCompilerErrorInExpression] The Value expression for the textbox ‘well_type’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

Build complete -- 1 errors, 2 warnings

If anyone has encountered a similar problem or an idea to resolve this. Please let me know - appreciate it.

Thanks

preps.

I used StrComp operator instead.

Syntax and usage for Like operator can be found at http://msdn2.microsoft.com/en-us/library/swf8kaxw.aspx

Cheers

preps

No comments:

Post a Comment