removing letters from a query?

J

Jason

Hi can someone tell me how I can remove extra letters from
field in an update query, such as xx.

Thank you.
 
J

John Vinson

Hi can someone tell me how I can remove extra letters from
field in an update query, such as xx.

Thank you.

Use the Replace() function. Exactly how you use it depends on which
version of Access you have installed, though! Please post some more
details (such as the fieldnames) and what version of Access you're
using.
 
R

Randy Harris

Jason said:
This is a practice database I am working on the fields
name is Field2, under which I have the name of States, I
have Texas as Texasxx for instance, I want to remove the
extra letters. Thank you for your assistance

Jason, you're not giving John much to go on. Is it always xx that you want
removed? The last two letters of the field? The sixth and seventh letters?
Any letters after an "s"? Any two letters at random?
 
G

Guest

-----Original Message-----



Jason, you're not giving John much to go on. Is it always xx that you want
removed? The last two letters of the field? The sixth and seventh letters?
Any letters after an "s"? Any two letters at random?
Randy, I am sorry. I am new at this, as well as Access,
Thank you for replying. It is the last two letters of the
field.
 
J

John Vinson

Randy, I am sorry. I am new at this, as well as Access,
Thank you for replying. It is the last two letters of the
field.

In order to remove the last two letters of the field named [State],
create a Query based on the table. Change it to an Update query (using
the query type icon, or the Query menu option).

On the Update To line type

Left([State], Len([State]) - 2)

This will calculate the length of the string in the STATE field, and
return two fewer characters - e.g. Texaszz will become Texas, ID will
become blank, and X will give you an error (since there aren't two
characters there to trim).
 
J

Jason

-----Original Message-----
Randy, I am sorry. I am new at this, as well as Access,
Thank you for replying. It is the last two letters of the
field.

In order to remove the last two letters of the field named [State],
create a Query based on the table. Change it to an Update query (using
the query type icon, or the Query menu option).

On the Update To line type

Left([State], Len([State]) - 2)

This will calculate the length of the string in the STATE field, and
return two fewer characters - e.g. Texaszz will become Texas, ID will
become blank, and X will give you an error (since there aren't two
characters there to trim).


.
 

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