I'm trying to format(in yyyymmdd) the previous month's first day within the SSIS 2005 expression builder. So far I have managed to get the year and month correctly represented. However, I'm stuck when it comes to the day part of the expression.
Below is the complete errorneous code which I'm trying to hack.
RIGHT((DT_WSTR, 4) YEAR( DATEADD( "mm",-1, getdate() )), 4) +
RIGHT("0" + (DT_WSTR,2) MONTH( DATEADD( "mm",-1, getdate() )), 2)+
RIGHT("0" + (DT_WSTR,2) DAY(DATEADD("mm", DATEDIFF("mm", 0, GETDATE())-1,0)),2)
The first line returns the year ( in yyyy format) the second line returns the month (mm format). However, I'm stuck at returning the day part (in format 01 or just 1) in the third line.
Any help is appreciated.