Thursday, October 11, 2012

Create a file name with today's date

Create a file name with today's date
 Expression on the Flat File or File Connection Manager:
"C:\\Project\\MyExtract" + (DT_WSTR, 30)(DT_DBDATE)GETDATE() + ".csv"
Expression Output Example: C:\Project\MyExtract2009-03-20.csv
 Use a 2 digit date
(ex. "03" for March instead of "3")
 RIGHT("0" + (DT_WSTR, 2)MONTH(GETDATE()),2)
Expression Output: 03 (if the month is March)

No comments:

Post a Comment