Argument data type for dateadd parameter
-
Monday, March 24, 2008 2:08 PM
I am using the following code in my SQL stmt in my OLE BD Source stmt:
WHERE ICINVENTORY.ICINVLastChgAt > ? AND ICINVENTORY.ICINVLastChgAt <= DATEADD(mi,?,?)
My parameters are as follows:
0 - User:LastSalesLoadDate DateTime variable
1 - User:Load Interval Int16 (or Int32)
2 - User:LastSalesLoadDate
When I try to close the program I get the following error:
"Argument data type datetime is invalid for argument 2 of dateadd function. If I can't use a datetime data type for the date time part of the dateadd, what can I use?
The exact same code runs without error in an EXECUTE SQL task.
Thanks.
All Replies
-
Monday, March 24, 2008 2:32 PMModerator
Try it with a string type that contains the date. -
Monday, March 24, 2008 2:50 PMThanks....I already converted my stmt to not use the DateAdd....I just use another package variable and do the DateAdd outside the SQL......
-
Tuesday, December 16, 2008 9:24 PMTry with this SQL query :
WHERE ICINVENTORY.ICINVLastChgAt > ? AND ICINVENTORY.ICINVLastChgAt <= DATEADD(mi, cast(? as int), ?)
or maybe :
WHERE ICINVENTORY.ICINVLastChgAt > ? AND ICINVENTORY.ICINVLastChgAt <= DATEADD(mi, cast(? as int), cast (? as datetime))
Alexis Leroy.

