I have a variable in my SSIS package.
@LastFridayDateTime = Datetime Datatype = DATEADD("hh",17,(DT_DBTIMESTAMP) ( (DT_STR,30,1252) (DT_DBDATE) (DATEADD("dd", -1 - (DATEPART("dw", getdate()) % 7), getdate()) ) ) )
This gives me a value = 6/14/2019 5:00:00 PM
Now I am trying to use dynamic Select query for my SSIS lookup expression. For that I am in the control flow, click on my Data Flow Task--> Properties --> Expression --> [Lookup].sqlcommand and tying my Select query.
"SELECT No, Date_tran
FROM TABLE
WHERE Date_tran >= " + (DT_STR,20,1252) @[User::LastFridayDateTime]
Which Evaluates to
SELECT No, Date_tran
FROM TABLE
WHERE Date_tran >= 6/14/2019 5:00:00 PM
And Hence its not working due to 5:00:00 PM I guess. My question is, I want this Date to be in this format '6/14/2019 5:00:00' rather than 6/14/2019 5:00:00 PM So that the query can compile and execute.