JuanBob
SSCertifiable
Points: 5059
More actions
March 28, 2006 at 4:59 pm
#112308
MSSQL2000
I have a table with column that contains a list of Filenames such as \Server\shared\filename.xls . Each folder and directory could be different. I need to extract the name of the file from this column so that I only see 'filename.xls'.
Any simple query that will do this for me?
Thanks!
[KH]
SSCommitted
Points: 1908
March 28, 2006 at 5:24 pm
#629322
selectright(FullPath, charindex('\', reverse(FullPath)) - 1)
from
(
select '\Server\shared\filename.xls' as FullPath
) p
March 29, 2006 at 9:55 am
#629561
Many thanks! I was not aware of the Reverse function so that can solve a few of my many problems.
thanks!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply