Discussion Locked

Access 2000 Data field update

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do you remove the ? ? and the number? at the end of various length identifiers
like these D848697A-1 2408824-1 80176992-7 in an Access data field?

4 replies

by john gordon

If the identifier ends with a - and a single number then use (where strID is a variable containing the identifier):

Left(strID, Len(strID) - 2)

Alternatively if the number at the end can have a variable number of digits then use:

Left(strID, Len(strID) - InStrRev(strID, "-"))

For an explanation of the Left, Len and InStrRev functions have a look at the Help or post back here and I will explain.

Hope this helps.

John

by devmann

What actually did it for me was;
Mid([stlID],1,InStr(1,[strlID]," - ",1)-1)

The first statement left out a few records with a "-".
The second statement removed most all data except for an occational few characters.
Thanks for attempt........GR

This discussion is closed to new replies.