I have a task that need to be done that contains the following:
I want to add as a source in the Data Flow a text file which is in a folder with concatenated date as name. For example:
somepath\YYYTMMDD
I want dynamically the ETL process to find the current date's folder and in that folder to find a file which its name starts with specific characters (DCA_)
So far, i have managed to identify the folder path (in which the subfolders exists) and to identify the last file based on the date.
The problem is that in the path in which the subfolder i want exists there are random files that may have been uploaded the current date.
Currently, using C#, i am able to extract the last date's file.
But how can i identify the last folder named with the date being concatenated?
Thank you.
Found it.
Create a package scoped variable with the following expression"
(DT_WSTR,100)YEAR(GETDATE()) + RIGHT("00" + (DT_WSTR,100)MONTH(GETDATE()),2) + RIGHT("00" + (DT_WSTR,100)DAY(GETDATE()),2)