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

undesirable characters in fields

Status
Not open for further replies.

delaap

Programmer
Jun 6, 2001
22
GB
Hi,
I have a field which is updated by another data source, the field contains characters that are invalid for its purpose. I cannot use i.e. / ? @ * but they are between other charcters that I do require, so my field looks like this '567AC?78'. Any ideas as to how I can replace the invalid character with a zero length string in one piece of code. At the moment I have 20 or so replace statements
Thanks
 
No easy way to do it in one statement, but you can nest replaces:

Code:
SELECT REPLACE(REPLACE(mycol, '?', ''), '@', '')

--James
 
Sure, here is the SQL:
Code:
Replace(Replace(Replace(Replace(YourField,'/',''),'?',''),'@',''),'*','')


Dan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top