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

Need to remove unwanted characters from string

Status
Not open for further replies.

sirnose1

Programmer
Nov 1, 2005
133
US
I have a column in a database with chemical Analytes. I need to remove the commas from these strings. For example:
I need to make C-1,2,3,4-TCDD look like C-1234-TCDD. There are 20 different constituents but I just want to remove the commas.
 
sirnose1,
[tt]Replace("C-1,2,3,4-TCDD",",","") = C-1234-TCDD[/tt]

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Just a note from a former analyte programmer.
Try using the CAS number. It's not full proof but more or less standard.

CautionMP's solution should do just fine.
djj
 
For some reason, These people wanted the "-" removed from the cas no., so I need do a find and replace for all the analytes, not just one, so I need a find and replace for the whole column. Mine doesenty seem to be woprking..
 
Your query in Access would look something like this:
Code:
UPDATE Categories SET Categories.CategoryName = Replace([CategoryName],"-","");
Hope this helps
djj
 
The query I used is this: "UPDATE tblMaster SET tblMaster.cas_no = Replace([cas_no],"-","");"
Doesent update the column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top