-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Probably a combination of REVERSE and PATINDEX, or CHARINDEX.
DECLARE strTemp VARCHAR(128)
SET strTemp = REVERSE(path_column)
-- Now that the string is reversed,
-- find the position of the 1st "\" char.
SET strTemp = SUBSTRING( strTemp, 1, CHARINDEX('\', strTemp) - 1 )
-- Now re-reverse the string to get the final result.
SET strTemp = REVERSE(strTemp)
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQcTrZYechKqOuFEgEQKFygCg5l5PjgvcUQKzEHFY+MQJlB JA6p8An1sI
EQk1QR5+r9GEdmv+JstCOrdZ
=AvAu
-----END PGP SIGNATURE-----
AGB wrote:
Quote:
I have a table that has a column of paths that look like:
\\developmentserv\mapped\share
I am trying to run a query that will just return the \share portion
when I select that row. Not sure how to get SUBSTR to recognize the
last instance of the \ character. |