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

SSIS :Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done

SSIS Error : Object is not an ADODB.RecordSet or an ADODB.Record + Solution

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