Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change part of a field entry... 1

Status
Not open for further replies.

matth

MIS
Apr 30, 2000
33
US
I need to update an inventory table. I want to change sku for current items and have it reflect on historical tables. The sku's look like, "B31510003" and I need to change 5 digits so that it will look like, "B31223003". How do I search for a pattern within a field and change only the pattern?
 
I noticed that when I don't clarify my statements, people have a hard time understanding me. Sorry about that.

This question is for Access 2000. The update will change up to 500 fields. Is there a simple SQL statement that will look for patterns in a field and change only the pattern without changing the entire field?
 
If I understand you correctly, I gather you are going to do this manually, one change at a time. The following SQL Update query will allow you to change the 4th through the 8th characters of your SKU:
Code:
UPDATE tblParts 
SET SKU = left(SKU,3) & "22300" & right(SKU,1)
where mid(SKU,4,5) like "51000";
Hope that helps...

Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
Though it appears you're getting perfectly good help right here from my buddy, Terry, just an FYI: there IS an Access forum where you don't have to deal with idiots like me! Um, I can create a database. I can even make a (built-in) macro run a report. What's SQL? (Hee hee--just kidding. But I've never used it! And now I know who to call, these unknowing people who email you, not realizing that you keep your email address FOREVER!)

Good luck, Matt.
Hey, Terry!
techsupportgirl@home.com
Brainbench MVP for Microsoft Word
 
Hiya DB... I agree, there is a forum completely dedicated to MS Access questions, but for the occaisional (sp) quick one, I or many others here can usually take care of it.

Matt, if you start getting in deep in Access development, try the Microsoft: Access - General discussion forum. There are lots of geniuses there. And me too...

Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top