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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi! I'm trying to replace any oc

Status
Not open for further replies.

leassaf

Instructor
May 20, 2001
49
IL
Hi!

I'm trying to replace any occurence of the symbol ; in the values of certain field. Is it possible through an SQL???

Assaf
 
Depends on the db. ASSUMING Ms. Access

In an UPDATE query, Update to

Replace(FieldName. ";", "")

Just deletes the ";". If you want something else in it's place;

Replace(FieldName. ";", "Char(s)")





MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
When trying this, I got error messages. I'm not sure that the replace function is supported in msAcceess SQL. could you be more specific with the syntax?

Assaf
 
Replace(String to Search, Char To Find, Replacement Char)

MyString = "This is the String To Search"
? Replace(MyString, " ", ";")
This;is;the;String;To;Search

In an UPDATE query, Update to (this is the ROW in the Query grid. "Replace is NOT an SQL function, but a VB / VBA function. I'm not positive it is in all versions. Try the example in the "immediate" / debug window. Just cut and paste the two lines, MyString = ... and ? Replace. If it gives an error something is awry. If it returns the same as my example it should work.





MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top