extracting LAST x characters of a string

B

Brian

I am creating a query in Access 2007. One of the fields stores the path to a
Word document. This path can be long and may look like:

G:\Projects\2009\00000-ABC Project\Correspondence\<filename>.doc

My hope is to be able to come up with a query that correctly returns the
<filename>.doc part of the string. Note that with the exception of the
G:\Projects\2009 part of the string, everything else can be variable in
length. Also, sometimes it's a .doc extension and sometimes a .docx
extension.

Can anyone tell me how to write a SQL statement to just extract the
<filename>.doc part?

Thanks!
 
B

Brian

Duane...you are a genius!
Thanks!!


Duane Hookom said:
Try something like:
Mid([One of the fields],Instrrev([One of the fields],"\")+1)
--
Duane Hookom
Microsoft Access MVP


Brian said:
I am creating a query in Access 2007. One of the fields stores the path to a
Word document. This path can be long and may look like:

G:\Projects\2009\00000-ABC Project\Correspondence\<filename>.doc

My hope is to be able to come up with a query that correctly returns the
<filename>.doc part of the string. Note that with the exception of the
G:\Projects\2009 part of the string, everything else can be variable in
length. Also, sometimes it's a .doc extension and sometimes a .docx
extension.

Can anyone tell me how to write a SQL statement to just extract the
<filename>.doc part?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top