Reputation: 41
SSIS expresion builder I have cast error cancnot convert string
to datetime
"SELECT *
FROM table Where OperatingDayDate>='"+@[User::MaxOperatingDayDateTime]
ERROR : CANNOT CONVERT STRING TO DATETIME
MaxOperatingDayDateTime IS variable DATETIME in SSIS OperatingDayDate is type DATE
Upvotes: 1
Views: 255
Reputation: 37313
You have to cast the variable data type:
"SELECT *
FROM table Where OperatingDayDate>='"+ (DT_WSTR,50)@[User::MaxOperatingDayDateTime] + "'"
One thing not mentioned, if you are using the SQL command in OLEDB Source you can use parameterized query:
SELECT * FROM table Where OperatingDayDate >= ?
Upvotes: 1