August 11, 2017 at 11:22 pm
Hi,
I need to remove any punctuation characters at the end and before new line.
Please help.
--rhythmk
------------------------------------------------------------------
To post your question use below link
https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
🙂
August 12, 2017 at 5:26 am
rhythmk - Friday, August 11, 2017 11:22 PMHi,
I need to remove any punctuation characters at the end and before new line.
Please help.
Can you provide an example please?
😎
August 12, 2017 at 2:24 pm
The DDL and sample data will help us understand what you're dealing with.
The third link in my signature contains guidance on asking questions and what's needed to provide a good, tested solution.
Also, what constitutes a "new line" in you data and what punctuation characters do you want to remove?
This doesn't sound difficult. We just need some specifics on what you want to do.
August 14, 2017 at 6:41 am
This might help you.
http://www.sqlservercentral.com/scripts/T-SQL/117890/
August 15, 2017 at 11:45 am
Eirikur Eiriksson - Saturday, August 12, 2017 5:26 AMrhythmk - Friday, August 11, 2017 11:22 PMHi,
I need to remove any punctuation characters at the end and before new line.
Please help.Can you provide an example please?
😎
E.g. input string is 'rh@ythm@#%' o/p should be 'rh@ythm' so all possible punctuation characters must be removed from end only.
--rhythmk
------------------------------------------------------------------
To post your question use below link
https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
🙂
August 15, 2017 at 12:09 pm
rhythmk - Tuesday, August 15, 2017 11:45 AMEirikur Eiriksson - Saturday, August 12, 2017 5:26 AMrhythmk - Friday, August 11, 2017 11:22 PMHi,
I need to remove any punctuation characters at the end and before new line.
Please help.Can you provide an example please?
😎E.g. input string is 'rh@ythm@#%' o/p should be 'rh@ythm' so all possible punctuation characters must be removed from end only.
This is a piece of cake, have a look at what Luis posted and the original function mentioned there. Come back if you have any problems with that.
😎
We did some substantial work on optimising this functionality and many good people pitched in on it, doubt you are going to find anything more efficient.
August 15, 2017 at 12:09 pm
rhythmk - Tuesday, August 15, 2017 11:45 AMEirikur Eiriksson - Saturday, August 12, 2017 5:26 AMrhythmk - Friday, August 11, 2017 11:22 PMHi,
I need to remove any punctuation characters at the end and before new line.
Please help.Can you provide an example please?
😎E.g. input string is 'rh@ythm@#%' o/p should be 'rh@ythm' so all possible punctuation characters must be removed from end only.
what about 'rh7ythm321' ,,,,are you expecting ' 'rh7ythm'
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
September 3, 2017 at 12:51 am
J Livingston SQL - Tuesday, August 15, 2017 12:09 PMrhythmk - Tuesday, August 15, 2017 11:45 AMEirikur Eiriksson - Saturday, August 12, 2017 5:26 AMrhythmk - Friday, August 11, 2017 11:22 PMHi,
I need to remove any punctuation characters at the end and before new line.
Please help.Can you provide an example please?
😎E.g. input string is 'rh@ythm@#%' o/p should be 'rh@ythm' so all possible punctuation characters must be removed from end only.
what about 'rh7ythm321' ,,,,are you expecting ' 'rh7ythm'
yes
--rhythmk
------------------------------------------------------------------
To post your question use below link
https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
🙂
September 3, 2017 at 8:46 am
maybe....
DECLARE @s-2 VARCHAR(100)= 'rh@ythm@#%';
SELECT SUBSTRING(@s,1, LEN(@s)-(PATINDEX('%[A-Za-z]%', REVERSE(@s))-1))
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
September 3, 2017 at 6:47 pm
rhythmk - Friday, August 11, 2017 11:22 PMHi,
I need to remove any punctuation characters at the end and before new line.
Please help.
Ok... your turn. 😉 What will you be using this for?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply