Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenation Question About Removing Spaces

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
0
0
US
Hi,

I have the following field in my report that concatenates the user's last name, then puts a comma, and then the user's first name -

=[monitor] & "," & [text50]

Problem is the results look like -

fontana , Sandra

how do i get the spaces out of there?
i can't make the field sizes shorter.

THANKS!
 
Use TRIM to remove leading and trailing spaces. LTRIM and RTRIM remove spaces to the left and right.

Syntax is easy...

=TRIM([monitor]) & ", " & TRIM([text50])

Note that I inlcuded a space after your comma.

Teh "gotcha" is if your variable is Null.

So perhaps a better alternative would be to use the NZ function...

=TRIM(NZ([monitor])) & ", " & TRIM(NZ([text50]))


Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top