Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Remove 2nd address

Author  Topic 

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2011-10-12 : 12:23:43
Notice in the code I add the second address, but most of the time it is not there, how do I remove the empty line if it is not there?

=Fields!Street.Value & VbCrLf & Fields!Street2.Value & VbCrLf & Fields!City.Value & ", PA " & Fields!Zip.Value

Dave
Helixpoint Web Development
http://www.helixpoint.com

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-12 : 12:29:12
=Fields!Street.Value & IIF(Len(Fields!Street2.Value) >0, VbCrLf & Fields!Street2.Value,"") & VbCrLf & Fields!City.Value & ", PA " & Fields!Zip.Value

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -