I want to return a row from a table through sql. Now the row returns this:
I want to return it like this:
I am using SQL Server so i tried something like this:
SUBSTRING(SI.Location, CHARINDEX('/', 2), 1) AS Testing
But this returns as blank so it doesn't work. Any ideas how i can get this working?
SI is the name of the table and Location is the row.
, LEN(SI.Location) -
) AS Testing
Thanks r937 that worked. I understand the CHARINDEX part where you are finding the index of where to start from.
Am i right in thinking that the LEN(SI.Location) - CHARINDEX('/', SI.Location, 1) is checking for the slash and removing up to it?
sort of, in a way... it's actually just a length calculation
the "removal" is done by the SUBSTRING function