Home Forums SQL Server 2005 T-SQL (SS2K5) Find last occurence of a character within a string RE: Find last occurence of a character within a string
Ramesh Saive
SSC-Insane
Points: 24275
More actions
April 8, 2009 at 7:52 am
#974291
Or this way too...
DECLARE @SomeFile VARCHAR(255)
SET @SomeFile = 'C:\WINDOWS\system32\FileName.xls'
SELECT RIGHT( @SomeFile, CHARINDEX( '\', REVERSE( @SomeFile ) + '\' ) - 1 )
--Ramesh