Hello
I have a field called path that will have a string value like so;
|734|654|890|999
|734|654|890|998
|734|654|888
|734|654|886
|734|550
I want to split the data up in to 4 columns, if a column is empty then I want the column to be empty.
I have some script's to split it, but it only works for |734|654|888 format;
Here are the scripts;
Column1
SUBSTRING(path,FINDSTRING(path,"|",1) + 1,FINDSTRING(path,"|",2) - FINDSTRING(path,"|",1) - 1)
Column2
SUBSTRING(path,FINDSTRING(path,"|",2) + 1,FINDSTRING(path,"|",3) - FINDSTRING(path,"|",2) - 1)
Column3
SUBSTRING(path,FINDSTRING(path,"|",3) + 1,LEN(path) - FINDSTRING(path,"|",3) + 1)
Column4
""
How do I change these script to handle the variable amount of columns I have?
Thank you for reading
Regards
SQLSearcher99