0

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.

Pedram
  • 6,256
  • 10
  • 65
  • 87
Will F
  • 417
  • 2
  • 6
  • 17

1 Answers1

0

You just need to specify the "is blank" bit for each part of the And;

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

As an aside, "less than a comma" is a super weird way of saying "is blank". I would expect IsNothing() to be used, so:

=Iif(IsNothing(fields!addressline1.Value) And IsNothing(fields!postcode.value), "No Details", Fields!addressline1.Value)

Of course if your way works, then I wouldn't worry.

Dan Scally
  • 1,922
  • 1
  • 19
  • 31
  • I chuckled at the 'super weird' comment. I did try the IsNothing argument but even though the report was showing a blank field, something was clearly coming through from the field (I have no idea what), which is why I used the strange <"," expression. So basically it wasn't blank, it just appeared so in the report. Anyhow, your answers above have been very helpful and have sorted my end so many thanks for replying. – Will F Nov 13 '14 at 11:13