SSIS Expression to Get Current Year and month in the format YYYY-MM

If we want to append current Year and month to the string  for example to the File name if we want append the current year nad month this the Expression we need to Use



(DT_WSTR,4)YEAR(GETDATE()) + "-" + RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()), 2)

we are Padding month number with zero to make it 2 digits .

See the Below example





Comments

Popular posts from this blog

SQL Server MDS : How to Know Actual MDS Table name for Model Entity and Column name for the Attribute

SSIS : Hresult: 0x80004005 Description: "Invalid character value for cast specification".

SSAS Error : XML parsing failed at line 1, column 0: A document must contain exactly one root element