Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    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. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,538
    Thanks
    0
    Thanked 23 Times in 23 Posts
    The following should do it:

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

  3. #3
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    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
  •