I am working on an SSIS package as to which I would like to create an Excel file with a timestamp with last weeks date number. The following works:
"Filename_" + RIGHT((DT_STR,4,1252)DATEPART("ww" ,GETDATE()), 4) + ".xls"
Which produces: Filename_2019_25.xls
However, we need to make this so that we are able to get Last Weeks' Week Number (instead of this week).
Desired file name: Filename_2019_24.xls
My initial thought was to do getdate()-7, but this does not work. Does anyone know if/how this might be possible?
Many Thanks in advance!