Problem
In SSIS expression the is no functions that can be used to change a date format
Solution
You can use the ? :
conditional to achieve this. Microsoft Docs article
The following expression can be use to convert the date value returned by GETDATE()
function to dd-MMM-yy
format:
RIGHT("0" + (DT_STR, 2, 1252) DATEPART("dd" , GETDATE()), 2) + "-" +
(DATEPART("mm" , GETDATE()) == 1 ? "JAN" :
DATEPART("mm" , GETDATE()) == 2 ? "FEB" :
DATEPART("mm" , GETDATE()) == 3 ? "MAR" :
DATEPART("mm" , GETDATE()) == 4 ? "APR" :
DATEPART("mm" , GETDATE()) == 5 ? "MAY" :
DATEPART("mm" , GETDATE()) == 6 ? "JUN" :
DATEPART("mm" , GETDATE()) == 7 ? "JUL" :
DATEPART("mm" , GETDATE()) == 8 ? "AUG" :
DATEPART("mm" , GETDATE()) == 9 ? "SEP" :
DATEPART("mm" , GETDATE()) == 10 ? "OCT" :
DATEPART("mm" , GETDATE()) == 11 ? "NOV" :
DATEPART("mm" , GETDATE()) == 12 ? "DEC" :"")
+ "-" + RIGHT( (DT_STR, 4, 1252) DATEPART("yy" , GETDATE()),2)
Other Solution
You can achieve this by adding a script task and writing a c# or Vb.net code to do this formatting
Dim FormatedDate as Date = Date.Now.ToString("dd-MMM-yy")