Jacque Scott
asked on
Getting certain data from a string
I have a string in the DB
"JRSJC2LPValueSummary(1220 12)pdf(117 9185).pdf"
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 ().
1179185
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.
"JRSJC2LPValueSummary(1220
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 ().
1179185
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.