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 2000 Forums
 Transact-SQL (2000)
 Removing Trailing Blank Characters in Strings

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-18 : 10:48:50
Albert writes "How do I remove blank characters at the end of a string beginning after the last non-blank character? For example, replacing "Phone     " with "Phone" and replacing "Phone Book     " with "Phone Book"."

PiecesOfEight
Posting Yak Master

200 Posts

Posted - 2002-01-18 : 11:24:06
RTRIM('Phone Book ')

Go to Top of Page

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-01-18 : 11:24:22
You can use RTRIM e.g.

RTRIM(<fieldname>)

see books on-line for RTRIM and LTRIM for more details

Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-01-19 : 00:02:32
if you have to remove the spaces from both the ends.

this should do it

rtrim(ltrim(fieldname))

HTH

----------------------------------
"True love stories don't have endings."
Go to Top of Page
   

- Advertisement -