Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Condition for IIF statement

Status
Not open for further replies.

bustercoder

Programmer
Mar 13, 2007
96
Hello, I have the visibility being set for a row according to a condition for field value comparison, which works:
=iif(Fields!SOP_TOTAL_DISC.Value <> Fields GL_TOTAL_DISC.Value, false,true)

But I need it to work to include other fields as well, something like this:
=iif((Fields!SOP_TOTAL_SALES.Value <> Fields!GL_TOTAL_SALES.Value) Or
(Fields!SOP_TOTAL_FREIGHT.Value <> Fields!GL_TOTAL_FREIGHT.Value) Or
(Fields!SOP_TOTAL_DISC.Value <> Fields!

But this doesn't work, the visibility just stays on if I do this. Could someone please tell me what I'm doing wrong? Is it a syntax problem? I'm hoping this isn't a limitation of SRS that would limit me to only one set of criteria on which to toggle the visbility property.

Thanks,
Buster

 
Hi,

What you're trying to do is certainly possible, you just need to alter your syntax:

Code:
=IIF(Fields!SOP_TOTAL_SALES.Value <> Fields!GL_TOTAL_SALES.Value OR Fields!SOP_TOTAL_FREIGHT.Value <> Fields!GL_TOTAL_FREIGHT.Value OR Fields!SOP_TOTAL_DISC.Value <> Fields!..., TRUE, FALSE)

If required, you can also Nest you IIF() statements too.

Hope this helps.



Cheers,
Leigh

The problem with common sense is that it isn't that common!

 
Hi Leigh,

Thanks, but the code returns an error:

Argument not specified for parameter 'TruePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.
Build complete -- 1 errors, 0 warnings

Any idea?

Thanks,
Buster
 
Can you post exactly what you have in your expression editor please?

Cheers,
Leigh

"If you had one shot, one opportunity, to seize everything you ever wanted, in one moment, would you capture it, or let it slip" - Eminem

 
It was due to a wrapping issue. When I place all on one line, it is fine. Thanks everyone. Very much appreciated!!!! Hope I can return the favor sometime.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top