Solved

sql query help

Posted on 2015-01-06
1
70 Views
Last Modified: 2015-01-06
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
Comment
Question by:romeiovasu
1 Comment
 
LVL 12

Accepted Solution

by:
Koen Van Wielink earned 500 total points
ID: 40534797
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now