Help in removing information from description

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

Hi All,

I have a listing of part# descriptions and I have been asked to remove some
data from the descriptions. The information that needs to be removed starts
with the letters RW: and I want to remove all the information that follows
the RW + the RW to the end of the description.

Example
TAPE,VINYL,WH,1IN X 36yds,6.0mil, RW:3468
TAPE,PLUMBERS,18 GUAGE,GALV, RW:10668
TAPE,JOINING FOR RANGE THRESHOLD, 1M, RW:70808232

What would be the best method?

Thanks
Matt
 
J

John W. Vinson

Hi All,

I have a listing of part# descriptions and I have been asked to remove some
data from the descriptions. The information that needs to be removed starts
with the letters RW: and I want to remove all the information that follows
the RW + the RW to the end of the description.

Example
TAPE,VINYL,WH,1IN X 36yds,6.0mil, RW:3468
TAPE,PLUMBERS,18 GUAGE,GALV, RW:10668
TAPE,JOINING FOR RANGE THRESHOLD, 1M, RW:70808232

What would be the best method?

Thanks
Matt

You can use the Left() function in conjunction with the Instr() function.
InStr will find the position of the RW:, and Left will let you extract the
portion of the text to the left of that point. Try

UPDATE Parts
SET Description = Trim(Left([Description], InStr([Description], "RW:") - 1))
WHERE Description LIKE "*RW:*";

Back up your database first of course, just in case! Note that as phrased this
will leave a trailing comma in each description - replace the "RW:" by ", RW:"
in both occurances if you want to get rid of the comma too.

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