Removing empty spaces

Posted by: pspdfppd

Removing empty spaces - 04/20/10 03:17 PM


has anyone had this problem:?

The variables go like this: @salutation@ @firstname@ @last name@ but if the person does not have a salutation then the first name starts out slightly right of being flush left with the text below


John Smith
abc company,

The space in front of John is the space that must be put in to separate the 3 fields. I tried LTRIM but that only seems to strip out empty spaces from the data base.

Any help appreciated.
Posted by: Anonymous

Re: Removing empty spaces - 04/20/10 03:37 PM


You can use an expression with an IF condition on your line to fix this. First, remove the space between your salutation and FirstName:
@Salutation@@Firstname@ @last name@

Then, edit your @salutation@ variable to the following:
IF(TRIM([Salutation]) <> "", [Salutation] & " ", "")

This will basically check if your salutation data field is empty. If it's not, it prints the salutation with a space. If it's empty, it prints nothing ("" being an empty string).

Hope this helps,
Posted by: pspdfppd

Re: Removing empty spaces - 04/20/10 06:35 PM