IIF Expression SSRS 2008R2 - advice appreciated

  • I have written an IIF statement:

    =IIF(fields!addressline1.Value< ",", "No Details", Fields!addressline1.Value)

    This works fine in that it returns 'no details' if the addressline1 value is blank. However, I would also like to add fields!postcode.value to the initial argument, something like:

    =IIF(fields!addressline1.Value AND fields!postcode.value < ",", "No Details", Fields!addressline1.Value) - but this isn't working.

    Any suggestions would be much appreciated - thanks.

  • Can't remember if the AND will work, you may need nested IIF functions, so one of these should work:

    =IIF(fields!addressline1.Value < "," AND fields!postcode.value < ",", "No Details", Fields!addressline1.Value)

    or

    =IIF(fields!addressline1.Value < ",", IIF(fields!postcode.value < ",", "No Details", Fields!addressline1.Value), Fields!addressline1.Value)

  • Option 1 worked well - thanks very much.

  • Great, no problem.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply