I'm using a flat file connection source in my SSIS Package. The filename has the following naming convention viz.,<<filename><year><month><date><time>>. Example - sample201703291515.txt. The filename would have different time appended to it as the file creation time would differ. I have created expressions in the connection string to fetch the name for the current date.
"c:\source\sample"+(DT_STR,4,1252)YEAR( DATEADD( "dd", -1, getdate() ))+DT_STR,4,1252)MONTH( DATEADD( "dd", -1, getdate() ))+(DT_STR,4,1252)DAY( DATEADD( "dd", -1, getdate() ))+".txt"
But since the time changes, is there any possibility to get the filename dynamically or is there any expression I can add up? Please help.