removing spaces from within strings

A

Alex

Hi

Is there a query i can run which will remove any spaces from within a field?

thanks
 
F

fredg

Hi

Is there a query i can run which will remove any spaces from within a field?

thanks

All spaces "I am a nice guy" to "Iamaniceguy"

NewString:Replace([FieldName]," ","")
 
M

Marshall Barton

Alex said:
Is there a query i can run which will remove any spaces from within a field?


Use the Replace function:

If the value is not editable, just use it in a Select query:
SELECT this, that, Replace(other, " ","")
FROM thetable

If you want to permantly change all the records in a table,
use it in in an Update query:

UPDATE thetable SET other = Replace(other, " ","")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top