newbie question

J

jlkjl;jkj

I have a field that contains both numbers and letters in a description field
from a general merchandiser. For example in the filed it says
"76080 9x12 clasp env 5ct" How can I get rid of the first 5 digits and the
space but keep the 9x12 clasp env 5 ct? Also to make things more difficult
the description is not consistent in that it doesn't always start with
numbers. Another item for example is this "Crazy 8 card game 31039"

Anyone got any ideas?

Mike
 
R

RobFMS

If you have a small amount of records to modify, its probably best to do it
manually.

Because you have indicated there is no consistent way of the data entry,
there probably is no 100% accurate coding you can do. Programmatically, you
have no indication if the "number" is valid or random (like the example you
gave below).


--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
J

John Vinson

I have a field that contains both numbers and letters in a description field
from a general merchandiser. For example in the filed it says
"76080 9x12 clasp env 5ct" How can I get rid of the first 5 digits and the
space but keep the 9x12 clasp env 5 ct? Also to make things more difficult
the description is not consistent in that it doesn't always start with
numbers. Another item for example is this "Crazy 8 card game 31039"

The first example is pretty easy: create an Update query based on the
table. To restrict it to those records which begin with five digits,
use a criterion of

LIKE "##### *"

and Update To

Mid([fieldname], 7)

to throw away the first six bytes (the five digits and the blank).

Similarly, if the five digits are at the end, a criterion of

LIKE "* #####"

and an UpdateTo of

Left([fieldname], Len([fieldname]) - 6)

will work.

If the five digits can appear in the MIDDLE somewhere... good luck,
that's going to be very difficult!

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Top