0

I'm trying to combine two fields into one text box in SSRS through an expression. If an address does have two entries, I'd like a line break between Addr1 and Addr2.

What I have currently is:

=Fields!Addr1.Value & VbCRLF &
Fields!Addr2.Value

But Addr2 may not have an entry so I'd like to be able to handle NULLS effectively.

I've tried:

=Fields!Addr1.Value & VbCRLF &
IIF(IsNothing(Fields!Addr2.Value),"",Fields!Addr2.Value

But that doesn't seem to work. Any suggestions on how to handle this?

Pedram
  • 6,256
  • 10
  • 65
  • 87
MISNole
  • 992
  • 1
  • 22
  • 48

1 Answers1

1

I believe you just need to change the order of your conditional concatenation:

=Fields!Addr1.Value & IIF(IsNothing(Fields!Addr2.Value),"",VbCRLF & Fields!Addr2.Value)

(I think you intended the VbCRLF to be conditional.)

Lynn Crumbling
  • 12,985
  • 8
  • 57
  • 95