How can I get these values with a match field that has different file extensions.

  • Hello and thank you for the help.

    I am trying to write a select statement where I can view 3 columns by a filename with a join statement. Unfortunately the value in both filenames match but their file extensions do not. Here is an example:

    6024500036687.pst.txt = 6024500036687.pst.msg.htm

    As you see the first piece of the filename match but the file extensions do not.

    Any suggestion will help. I am fairly green and would greatly appreciate the help.

  • Hi)

    If the filename is the part of string before the first ".", you can use:

    declare @name nvarchar(15)

    set @name='filename.extention'

    select substring(@name, 0, charindex('.',@name))

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply