• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 80
  • Last Modified:

sql query help

hi all
i have customer field name as custfield and the data is stored as "NYS INCOME TAX,"
i want to remove those quotes in the front and the end and remove the ,
i need something like this NYS INCOME TAX
can someone tell me how to do this in sql query
0
romeiovasu
Asked:
romeiovasu
1 Solution
 
Koen Van WielinkIT ConsultantCommented:
Use this:

update yourTable
set custfield = REPLACE(REPLACE(custfield, '"', ''),',','')

Open in new window


Of course you have to be sure there are no quotes and commas in the string itself that you want to keep. If there are, we have to modify the logic a bit.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now