February 16, 2009 at 7:49 am
I have a exspression which I use to get the current date including the file name:
"Process completed successfully for " + (DT_STR, 4, 1252) YEAR
( GETDATE()) + "-" + RIGHT("0" + (DT_STR, 2, 1252) MONTH( GETDATE
()), 2) + "-" + RIGHT("0" + (DT_STR, 2, 1252) DAY(GETDATE() ), 2)
How would I change this to get yesterdays date?
i.e. GETDATE() -1
Thanks
February 16, 2009 at 8:04 am
...DATEADD( "Day", -1, GETDATE() )
--Ramesh
February 16, 2009 at 8:09 am
Or DATEADD("d",-1,GETDATE())
(I forgot that SSIS needs the quotes).
Derek
February 16, 2009 at 8:28 am
Thanks Guys,
Im how would the whole exspresion look?
In regards to my code posted abouve?
February 16, 2009 at 8:38 am
...Just need to replace GETDATE() with DATEADD( "Day", -1, GETDATE() ) in the expression
--Ramesh
February 16, 2009 at 8:45 am
"Process completed successfully for " + (DT_STR,4,1252)[YEAR]([DATEADD]("d",-1,[GETDATE]())) + "-" +
("0" + (DT_STR,2,1252)[MONTH]([DATEADD]("d",-1,[GETDATE]())),2) + "-" +
("0" + (DT_STR,2,1252)[DAY]([DATEADD]("d",-1,[GETDATE]())),2)
Derek
February 16, 2009 at 8:56 am
thanks Derek, worked well!
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply