blank info

Technical information that doesn't fall into any of the other categories in this forum.

Moderators: Chrissy, Steve, Terry, Donna, Dave, Eric, MartyH, Kristen, Geoff, Vince

Post Reply
Royle
Private
Posts: 2
Joined: Tue Jul 07, 2009 12:58 pm
Location: Germantown, MD
Contact:

blank info

Post by Royle » Fri Dec 18, 2009 7:03 am

I am setting up a label with these fields on one line Sal Firstname middle last name. i have a space between each field in the label. If i don't place the space between each field they but up against each other

Ssome of the Sal and middle fields are blank. in the label it leaves a blank pace when the field is blank. is there a way to correct this?

pilviaccuzip
Private
Posts: 8
Joined: Mon Jul 30, 2007 9:57 am
Location: Santa Rosa, California
Contact:

Post by pilviaccuzip » Mon Dec 28, 2009 3:23 pm

You can simply use the reduce function.

Normally your expression (that doesn't quite do what you want) might look like:
alltrim(alltrim(sal)+" "+alltrim(first)+" "+alltrim(mid)+" "+alltrim(last))
which will get rid of the leading space if sal is blank but will leave two spaces between First and Last when Mid is blank.

To solve this:
reduce(sal+" "+first+" "+mid+" "+last)

The reduce function gets rid of all trailing and leading spaces for the entire string and reduces any double or more spaces between substrings. It does the trick for me.

I hope this helps!

Pilvi

Post Reply