Trim Trailling Spaces

45 pts.
Tags:
Concatenate
TRIM function
How do I trim trailling spaces when I concatinate 2 character fields. Like when you concat names there is a big space between the 2 names.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Some databases support te TRIM function, others suppor the LTRIM and RTRIM functions.

<pre>SELECT TRIM(FirstName) || ‘ ‘ || TRIM(LastName)
FROM YourTable

SELECT RTRIM(FirstName) + ‘ ‘ RTRM(LastName)
FROM YourTable</pre>

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Denny Cherry
    Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    69,000 pointsBadges:
    report
  • Arnelr
    Thanks Mrdenny but what I'm referring to here is query command in AS/400.
    45 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: