help removing 3 extra spaces/update

H

Helen

hello: Can some one tell me how to enter the expression in
an Upadate query, which will remove the 3 extra spaces
that are in a field called Sentence. The field constists
of Sentences.
 
C

Cheryl Fischer

The Trim() function does that. For example, if the field with the extra
spaces is named MyField, you would update it in your Update Query as
follows:

Field: MyField
Table: MyTable
Update To: Trim([MyField])

hth,
 
H

Helen

This did not work. I want to remove the 3 extra spaces
that are in this Sentence field. (they are in the middle
of the sentences etc.) Thank you for your help

-----Original Message-----
The Trim() function does that. For example, if the field with the extra
spaces is named MyField, you would update it in your Update Query as
follows:

Field: MyField
Table: MyTable
Update To: Trim([MyField])

hth,


--
Cheryl Fischer
Law/Sys Associates
Houston, TX

hello: Can some one tell me how to enter the expression in
an Upadate query, which will remove the 3 extra spaces
that are in a field called Sentence. The field constists
of Sentences.


.
 
J

John Vinson

This did not work. I want to remove the 3 extra spaces
that are in this Sentence field. (they are in the middle
of the sentences etc.) Thank you for your help

please post an example. Do you want to change

This is a sentence with three consecutive blanks

to

This is a sentence with three consecutive blanks

OR

This is a sentence with three blanks

to

Thisisasentence with three blanks

OR

This is a sentence with three consecutive blanks

to

This is a sentencewith three consecutive blanks

Any of these options are correct answers to the question AS YOU HAVE
POSED IT. Remember - *you* can see your data. We cannot.
 
H

Helen

-----Original Message-----
This did not work. I want to remove the 3 extra spaces
that are in this Sentence field. (they are in the middle
of the sentences etc.) Thank you for your help

-----Original Message-----
The Trim() function does that. For example, if the field with the extra
spaces is named MyField, you would update it in your Update Query as
follows:

Field: MyField
Table: MyTable
Update To: Trim([MyField])

hth,


--
Cheryl Fischer
Law/Sys Associates
Houston, TX

hello: Can some one tell me how to enter the
expression
.
 
H

HELEN

Here are two examples
The newer compu ters have not worked.
AND
This is a story about newest data.
 
D

Douglas J. Steele

You could use the Replace statement, telling it to change " " to "".
However, note that in your second example, you'll end up with

This is a storyabout newest data.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)
 
J

John Vinson

Here are two examples
The newer compu ters have not worked.
AND
This is a story about newest data.

Run an Update query based on your table.

Update the field (which I'll presume is named [Sentence]) to

REPLACE([Sentence], " ", "")

As Douglas says... computers HAVE NO INTELLIGENCE; they will do
exactly what you ask, replacing " " with ""; your second example
will indeed contain "storyabout". Access has no way to know that
"story" and "about" are two different words, whild "compu" and "ters"
are just one.
 

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