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

SSAS : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. (Microsoft.AnalysisServices.AdomdClient). + Solution

SSIS Error : Unable to infer the XSD from the XML file. The XML contains multiple namespaces

SSRS : [Teradata Database] 3939 There is a mismatch between the number of parameters specified and the number of parameters required.