June 5, 2013 at 6:39 am
Hi All
I need to select the document file extention but I'm not getting the same results if the fileName has more that one dot "."
e.g
C:\Documents and Settingskiewiedo001\Desktopatalie Cv.doc = doc --Which is the results I want
and
C:\Documents and Settings\HRTemp001.ZADBNHRW1\Desktop\cv.doc = ZADBNHRW1\Desktop\cv.doc --starting after the first "."
How do I get just the file extension using the query below?:
Select CVFileName
,RIGHT(CVFileName, len(CVFileName) - charindex('.', CVFileName))
From CandCV
Thanks.
Teee
June 5, 2013 at 6:52 am
Something like this..
SELECTCVFileName
,RIGHT(CVFileName,CHARINDEX('.',REVERSE(CVFileName),0)-1)
FROMCandCV
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
June 5, 2013 at 6:58 am
Thank you so much, it works perfectly 🙂
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply