Reputation: 457
I'm taking the last updated date from SQL table as below:
SELECT CONVERT(DATETIME, [Value]) AS LastModifiedDate
FROM [WarehouseDB].[dbo].[tblWarehouseSettings]
WHERE Name = 'LastModifiedDate'
[Value]
is varchar.
A variable as below:
I'm using an Execute SQL Task to get the date value & assign it to the variable. My Execute SQL Task Editor values set as below:
The task executed successfully but it doesn't get the value from the DB. Assigned value to the variable after the task execution is {12/30/1899 12:00:00 AM}
Can anyone figure out what I'm doing wrong here?
Upvotes: 2
Views: 9241
Reputation: 37313
There are 2 things that caused this issue :
@[User::LastUpdateOn]
as an Output parameter in Parameters mapping Tab[Value]
column to DATETIMEOFFSET
instead of DateTime
and DT_DBTIMESTAMP
is related to DateTime
SQL Data TypeReferences
Upvotes: 2