In the script task how would you do something like this.....
If the file name is like 'NAV Performance%' or substring(filename, 1, 15)='NAV Performance' then run this code
begin
Dts.Variables.Item("User::FileDate").Value = CDate(Mid(Dts.Variables("FileName").Value.ToString(), 17, 10)).ToString("YYYY-MM-DD")
end
ELSE if the file name like 'NAVPerf_%' or substring(filename, 1, 8)='NAVPerf_' then run this code
Begin
FileDate = Mid(fi.Name, InStr(fi.Name, "_") + 1, 8) 'fi.Name, (Len(fi.Name) - 5)), "_")
FileDay = Right(FileDate, 2)
FileMonth = Mid(FileDate, 5, 2)
FileYear = Left(FileDate, 4)
Dts.Variables.Item("User::FileDate").Value = CDate(FileMonth & "/" & FileDay & "/" & FileYear).ToString("MM/dd/yy")
End
I don't know how to substring in VB in the script task.
lcerni