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?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
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 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply