December 19, 2014 at 5:40 am
Hello comunity
I need to build a query, or use a function to removing alfabetic Character from a string.
My string is
WI14000323-0003
the value i want to keep is : 14000323-0003.
I try using this SELECT:
SELECT STUFF(Upper(z.lote), PATINDEX('%[A-Z]%', Upper(z.lote)), 2, '') from mytable
but in this case i have only 2 letters WI, but in the future i dont know if is only 2 letters, 1 letter or more, then is not what i pretend.
Someone could give a suggestion.
Best regards,
Luis Santos
December 19, 2014 at 6:13 am
take a look at this thread for some high performance strip-non-numeric functions.
you would need to change it so that it also allows dashes, but that's a trivial tweak:
do you have a StripNonNumeric ITVF function?
i've taken that and made versions for Non-Alphanumeric,Non-AlphaBetical,and some similar custom versions to allow certain punctuation.
Lowell
December 19, 2014 at 9:35 am
Hello Lowell
Thanks for your reply.
Best regards,
Luis Santos
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply