andreadd
MIS
- Jan 15, 2008
- 67
SQL 2008 R2 / Goldmine Premium 9
I have a text field that contains a file path
c:\docs\mydoc.doc
I need to write a query that drops off both ends so all you get is:
\docs
the length of these paths vary quite a bit.
substring(replace(cast(linkeddoc as varchar(max)), substring(cast(linkeddoc as varchar(max)), 1, charindex(':', linkeddoc)),''),1,
this is succesfully removing the drive letter. so i am now seeing:
\docs\mydoc.doc
my issue is dropping the filename -any ideas of how i can accomplish this? TIA for your help
I have a text field that contains a file path
c:\docs\mydoc.doc
I need to write a query that drops off both ends so all you get is:
\docs
the length of these paths vary quite a bit.
substring(replace(cast(linkeddoc as varchar(max)), substring(cast(linkeddoc as varchar(max)), 1, charindex(':', linkeddoc)),''),1,
this is succesfully removing the drive letter. so i am now seeing:
\docs\mydoc.doc
my issue is dropping the filename -any ideas of how i can accomplish this? TIA for your help