Link to home
Start Free TrialLog in
Avatar of Jacque Scott
Jacque ScottFlag for United States of America

asked on

Getting certain data from a string

I have a string in the DB

"JRSJC2LPValueSummary(122012)pdf(1179185).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.
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial