Delele specific character in a string

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Access 2000:

I have a group of numbers which are formatted as text where I have to delete
the 8th character. An example is

44-12340-231-66-21

I need to delete the 8th character which is a zero. There can be other zeros
in the other postions.

Any help will be appreciated.

Pete Provencher
 
M

msnews.microsoft.com

I figured it out. Just parsed out the first 7 characters and the last
characters and then put them together.

Pete Provencher
 
S

splashout1

one way around it would be to create a new field joining the bits you
do want.

using something like:
Left([field to be evaluated],7) & Mid([field to be evaluated],9,99999)

in a query will give you what is in the field with the 8th character
removed.

regards
Glyn
 
J

John Vinson

Access 2000:

I have a group of numbers which are formatted as text where I have to delete
the 8th character. An example is

44-12340-231-66-21

I need to delete the 8th character which is a zero. There can be other zeros
in the other postions.

Any help will be appreciated.

Pete Provencher

An Update query would do this. It's a bit risky and irreversible, so
*make a backup first!*

UPDATE yourtable
SET [fieldname] = Left([fieldname], 7) & Mid([fieldname], 9);

will (when you use your own table and field names) update every record
in the table to replace the current contents of the field by editing
out the eighth character (whatever it is, this query doesn't check
that it's zero).


John W. Vinson[MVP]
 

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