"replace" function in SQL

  • Thread starter Thread starter JasonS
  • Start date Start date
J

JasonS

Good mornig / evening everybody!
I've got a question. Is there any way to modify a record within MS Access 2K
database using SQL?
Let's say that there is a field with such values (text):
wer234/4gd
2jklrumuu/ewq3
reew/kk62
344bn/ppppppppp
etc...

These values do not have same amount of characters..
What I want to do is to remove "/" (slashes) from these values. How can I do
it using SQL, or, if there is not such function in SQl, maybe it's possible
using VBA6?

Thank you 4 your help
 
Jason,

The following query will replace all occurrences of slashes ( / ) in every
record in the table, with nothing:
UPDATE tblMyTable SET myField = Replace(myField, "/", "")
Rename all the objects to reflect the names you have given them, then run
the query.

The following query will replace all occurrences of slashes ( / ) in a
specific record, with nothing:
UPDATE tblMyTable SET myField = Replace(myField, "/", "") WHERE
someField = 123
Again, rename all the objects to reflect the names you have given them, and
change 123 to some meaningful value. Then run the query.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 

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

Back
Top