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)
 Trim Function SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-06-07 : 11:25:30
Billinho writes "Hi there,

I have a problem thats causing me grief!!

I want to trim spaces within a field. I.E.

Postcode
---------
AV1 1AA
AV12 1AA
B1 1BB

I want to trim all spaces from the entire field so that is shows:

Postcode
---------
AV11AA
AV121AA
B11BB

I would be really grateful if you could offer some wisdom here!

Thanks very much.
Billinho"

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-06-07 : 11:27:39
use replace function
select replace(PostCode, ' ', '')

Go with the flow & have fun! Else fight the flow
Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"]
Go to Top of Page
   

- Advertisement -