November 9, 2022 at 2:17 pm
All,
I have a field, SourceID, that looks like the folloing
V0008048
V0011675
V0000145
In each instance I need to remove the V and all of the zeros, so I should return the following:
8048
11675
145
Ive tried a replace, trims and nothing will work. Is this possible?
Thank you!
November 9, 2022 at 2:56 pm
Have a look at this thread
November 9, 2022 at 6:40 pm
If it will always be that you have a non-numeric first character and the rest are numeric, this will work very quickly...
SELECT CONVERT(INT,SUBSTRING(yourstring,2,8000))
--Jeff Moden
Change is inevitable... Change for the better is not.
November 9, 2022 at 6:41 pm
Have a look at this thread
That's a long thread. You might want to provide the post number for where we ended up on that thread.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 10, 2022 at 11:40 am
Eirikur Eiriksson wrote:Have a look at this thread
That's a long thread. You might want to provide the post number for where we ended up on that thread.
Good point Jeff!
Here is a link to the functions
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy