Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    505
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Extra file name from a field in SQL

    Hi,

    I have fields with image file locations stored within the SQL database.

    I need to be able to retrieve just the file name and extension from the field, ie every after the last '\'.

    How can I do this in SQL?

    The table is tblproperty and field is PICFILE
    Best Regards,

    Luke

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,536
    Thanks
    0
    Thanked 23 Times in 23 Posts
    The following should do it:

    FilenameExt: Mid(PICFILE, InStrRev(PICFILE, "\", , vbBinaryCompare) + 1)

  4. #3
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    505
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you.
    Best Regards,

    Luke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •