I'm struggling to get my head around a problem I have, I'm trying to create two fields from one Productcategories.fullpath
.
The first will take the data before the first slash, which is working well.
Below is the code I have for this:
LEFT(Productcategories.Fullpath, CHARINDEX('/',ProductCategories.Fullpath + '/') - 1) as shortpath,
The second issue I have, is I now need to also extract between the second and third slash into another column called middlepath.
I can't get this to work for love nor money, the data is made up of three units separated by /.
If anyone can help, I will be eternally grateful, as SQL I can do a little, but i'm no programmer.
Data looks like Products\lifts\small lifts (length can vary considerably).
Output should be the "Lifts" part