I need to drop the first and last character of each field entry..

S

Stephanie

I am importing a text file that has a "<" at the beginning and a ">" at the
end of each data field. The field lengths vary from 4 characters to 50
characters. I need to find a way to clean up the beginning and ending
character of each.

Can you help??
 
A

Alex White MCDBA MCSE

Hi,

strTest = Mid(yourfield, 1, Len(yourfield) - 2)

That should do it...
 
S

Steve Schapel

Stephanie,

You can use an Update Query for this. Make a query based on the
imported table, make it an Update Query (select Update from the Query
menu in query design), and in the Update To row of the grid, for all of
the affected fields, put the equivalent of:
Mid([NameOfField],2,Len([NameOfField])-2)
Run the update query (try it on a backup copy first!)
 

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