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
(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
Post a Comment