June 17, 2019 at 1:40 pm
Thanks all. Here is the SSIS expression for those who only need to use SSIS,
DATEADD("hh",17,(DT_DBTIMESTAMP) ( (DT_STR,30,1252) (DT_DBDATE) (DATEADD("dd", -1 - (DATEPART("dw", getdate()) % 7), getdate()) ) ) )
June 17, 2019 at 2:06 pm
Thanks all. Here is the SSIS expression for those who only need to use SSIS, DATEADD("hh",17,(DT_DBTIMESTAMP) ( (DT_STR,30,1252) (DT_DBDATE) (DATEADD("dd", -1 - (DATEPART("dw", getdate()) % 7), getdate()) ) ) )
If I run this now, I get this:
15/06/2019 17:00:00
which, of course, is Saturday. Are you sure that it's working for you?
June 17, 2019 at 2:09 pm
Mya be you have some different collation or timezone setting. Here is what I am getting. 6/14/2019 5:00:00 PM
June 17, 2019 at 4:16 pm
Mya be you have some different collation or timezone setting. Here is what I am getting. 6/14/2019 5:00:00 PM
My recommendation would be to rewrite it so that it does not use the "DW" DATEPART so that it's agnostic to DATEFIRST and other settings.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy