October 28, 2009 at 5:25 pm
Hello,
I am looking to produce a query that will eliminate a whole word from a field.
Ex. Going To School
I would like to get rid of the word 'Going', as well as eliminate any spaces to the left of 'To'.
Thank you
October 28, 2009 at 7:57 pm
Take a gander at the REPLACE function in Books Online... that should do the trick.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 28, 2009 at 8:30 pm
Also look up LTRIM/RTRIM in Books Online - that should take care of the leading/trailing spaces.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
October 29, 2009 at 3:33 am
hi,
this way you can do that
DECLARE @string VARCHAR(100)
SET @string = 'going to school'
SELECT ltrim(REPLACE(@string,'going',''))
Raj Acharya
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply