Query to delete extra spaces after input

G

Guest

I need a query that will delete spaces after the text in the field. I have
code that pulls the 10 chars that populate this field from a very long
string. The problem is I don't know if my actual data is 6, 8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code I get 4 spaces
following it and I want those deleted.

Can anyone help?
 
G

Guest

Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.
 
G

Guest

I can't get the syntax of the update query correct. Could you show me what
it should look like? Every time I think I get it it won't let me save and it
says I have syntax errors

KARL DEWEY said:
Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.


julialatte said:
I need a query that will delete spaces after the text in the field. I have
code that pulls the 10 chars that populate this field from a very long
string. The problem is I don't know if my actual data is 6, 8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code I get 4 spaces
following it and I want those deleted.

Can anyone help?
 
G

Guest

Post your SQL statement.

julialatte said:
I can't get the syntax of the update query correct. Could you show me what
it should look like? Every time I think I get it it won't let me save and it
says I have syntax errors

KARL DEWEY said:
Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.


julialatte said:
I need a query that will delete spaces after the text in the field. I have
code that pulls the 10 chars that populate this field from a very long
string. The problem is I don't know if my actual data is 6, 8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code I get 4 spaces
following it and I want those deleted.

Can anyone help?
 
G

Guest

UPDATE Clean_Export SET Replace(Rec_Ident," "," ");

KARL DEWEY said:
Post your SQL statement.

julialatte said:
I can't get the syntax of the update query correct. Could you show me what
it should look like? Every time I think I get it it won't let me save and it
says I have syntax errors

KARL DEWEY said:
Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.


:

I need a query that will delete spaces after the text in the field. I have
code that pulls the 10 chars that populate this field from a very long
string. The problem is I don't know if my actual data is 6, 8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code I get 4 spaces
following it and I want those deleted.

Can anyone help?
 
G

Guest

Sorry, that is not what I am looking for. Open your query in design view,
click on menu VIEW - SQL View. Highlight, copy, and paste in a post.


julialatte said:
UPDATE Clean_Export SET Replace(Rec_Ident," "," ");

KARL DEWEY said:
Post your SQL statement.

julialatte said:
I can't get the syntax of the update query correct. Could you show me what
it should look like? Every time I think I get it it won't let me save and it
says I have syntax errors

:

Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.


:

I need a query that will delete spaces after the text in the field. I have
code that pulls the 10 chars that populate this field from a very long
string. The problem is I don't know if my actual data is 6, 8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code I get 4 spaces
following it and I want those deleted.

Can anyone help?
 
G

Guest

That is what it looks like, I was attempting to type it in SQL myself. I was
in SQL view.

KARL DEWEY said:
Sorry, that is not what I am looking for. Open your query in design view,
click on menu VIEW - SQL View. Highlight, copy, and paste in a post.


julialatte said:
UPDATE Clean_Export SET Replace(Rec_Ident," "," ");

KARL DEWEY said:
Post your SQL statement.

:

I can't get the syntax of the update query correct. Could you show me what
it should look like? Every time I think I get it it won't let me save and it
says I have syntax errors

:

Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.


:

I need a query that will delete spaces after the text in the field. I have
code that pulls the 10 chars that populate this field from a very long
string. The problem is I don't know if my actual data is 6, 8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code I get 4 spaces
following it and I want those deleted.

Can anyone help?
 
G

Guest

Make a backup of the table.

Ok, create a new query. On the icon bar click on the icon that looks like
two datasheets and an qrrow on the right side. Select Update query.

In the design grid in the row labeled Update To: enter Replace(Rec_Ident,"
"," ") and run the query.

You may have to run it several times to eliminate all of the extrat spaces.

julialatte said:
That is what it looks like, I was attempting to type it in SQL myself. I was
in SQL view.

KARL DEWEY said:
Sorry, that is not what I am looking for. Open your query in design view,
click on menu VIEW - SQL View. Highlight, copy, and paste in a post.


julialatte said:
UPDATE Clean_Export SET Replace(Rec_Ident," "," ");

:

Post your SQL statement.

:

I can't get the syntax of the update query correct. Could you show me what
it should look like? Every time I think I get it it won't let me save and it
says I have syntax errors

:

Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.


:

I need a query that will delete spaces after the text in the field. I have
code that pulls the 10 chars that populate this field from a very long
string. The problem is I don't know if my actual data is 6, 8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code I get 4 spaces
following it and I want those deleted.

Can anyone help?
 
J

John Spencer

UPDATE Clean_Export
SET Rec_Ident = Replace(Rec_Ident," "," ")
WHERE Rec_Ident is not null


KARL DEWEY said:
Make a backup of the table.

Ok, create a new query. On the icon bar click on the icon that looks like
two datasheets and an qrrow on the right side. Select Update query.

In the design grid in the row labeled Update To: enter Replace(Rec_Ident,"
"," ") and run the query.

You may have to run it several times to eliminate all of the extrat
spaces.

julialatte said:
That is what it looks like, I was attempting to type it in SQL myself. I
was
in SQL view.

KARL DEWEY said:
Sorry, that is not what I am looking for. Open your query in design
view,
click on menu VIEW - SQL View. Highlight, copy, and paste in a post.


:

UPDATE Clean_Export SET Replace(Rec_Ident," "," ");

:

Post your SQL statement.

:

I can't get the syntax of the update query correct. Could you
show me what
it should look like? Every time I think I get it it won't let me
save and it
says I have syntax errors

:

Do an update on the field with Replace([YourField]," "," ")
This replaces a double space with a single spece.

Trim([YourField]) will remove any leading and trailing spaces.


:

I need a query that will delete spaces after the text in the
field. I have
code that pulls the 10 chars that populate this field from a
very long
string. The problem is I don't know if my actual data is 6,
8, or in fact 10
chars.

So now that I have populated my field if I have a 6 char code
I get 4 spaces
following it and I want those deleted.

Can anyone help?
 

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