Approach to retrieve the value "5000009" from the string 01-4211002-00000000-0000-CH10-0000-5001044-
Summary:
I used the below, but it is giving syntax error. Can some one please assist and provide me corrected query
SUBSTRING(
"GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments") + 1
) + 1
) + 1
) + 1
) + 1
) + 1
) + 1 , -- Moves to start of the 7th segment
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",
LOCATE('-', "GL Account"."Concatenated Segments",