Getting certain data from a string
Posted on 2016-11-08
I have a string in the DB
I need to get the number between the (). If there is more than one set of (), like in this example, then I need the number from the 2nd set of ().
I can get the first set by using this:
substring([FileName], charindex('(', [FileName]) + 1, charindex(')', [FileName]) - charindex('(', [FileName]) - 1) AS DocumentNumberParsed
I don't know how to get the 2nd set IF there is a 2nd set.
I appreciate any help.