0

I am working in SSRS SQL Server

I have several different strings and I want to extract information.

Examples: /features/all_tests/access/login.feature /features/all_tests/display/reactions_page/reaction_results_display.feature

I want to remove everything from the third ‘/’ and before and everything after the last /

Results would be: access display/reactions_page

I have used below to get the last portion ,REVERSE(left(REVERSE(tests.[path]), charindex('/',REVERSE(tests. [path]))-1))

I have also used the below to extra some additional information

,substring(tests.[path],
CharIndex('/', (tests.[path]), 11)+1, 
(CharIndex('/',((substring(tests.[path], 
CharIndex('/', (tests.[path]), 12)+1, 77))),1)-1))

I can do everything around it but can’t get it to combine

BIReportGuy
  • 799
  • 3
  • 13
  • 36
nanashr
  • 1
  • 1

1 Answers1

0

You may want to refer on this posts?

SQL Server - find nth occurrence in a string

It should answer your question. Find the position and work with your concatenation.

Community
  • 1
  • 1
lucas
  • 101
  • 1
  • 9