dbTalk Databases Forums  

remove blanks/spaces

comp.databases.ms-access comp.databases.ms-access


Discuss remove blanks/spaces in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tt
 
Posts: n/a

Default remove blanks/spaces - 08-05-2003 , 07:18 PM






I have a column in an Access Table that contains text data. I'm writing a
query and want to remove all spaces in the column. Trim will remove the
leading and trailing ones, but is there a way to remove all the blanks. For
example if the column contain ' A B C ' I would want 'ABC' returned.

JC



Reply With Quote
  #2  
Old   
John MacIntyre
 
Posts: n/a

Default Re: remove blanks/spaces - 08-05-2003 , 09:11 PM






"tt" <tt@2> wrote

Quote:
I have a column in an Access Table that contains text data. I'm writing a
query and want to remove all spaces in the column. Trim will remove the
leading and trailing ones, but is there a way to remove all the blanks.
For
example if the column contain ' A B C ' I would want 'ABC' returned.

JC
Hi JC,

A good place to start might be the Replace( ) function.

Replace(" A B C ", " ", "") will return "ABC"

But, you might want to check out how this function will handle non-space
'white space' characters like tabs and line feeds. I suspect you may need
something a little stronger or need to tweak Replace( ) a bit.

Hope this helps,
John MacIntyre
VC++ / VB / ASP / Database Developer
http://www.johnmacintyre.ca





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.