ODBC Timestamp in DTS Import

Last Post 27 Mar 2006 11:54 PM by SQLUSA. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

23 Mar 2006 10:25 AM
I am importing data via an ODBC connection - an AR System ODBC driver specifically.

I am trying to constrain the import using a query, specifically by date. SQL Server documentation states that an ODBC Timestamp must be used. See documentation here: http://msdn2.microsoft.com/en-us/li.../ms190234.

So my query looks something like:

select "AR_Table1"."Record_ID",
from "AR_Table1"
where "AR_Table1"."Create_Date" > {ts '2006-01-01 12:00:00'}

However, I would like to constrain the data to just the previous day using function, instead of a specific date. When I use anything but the "ts" syntax, I get an error. Depending on the type of function I use, the error messages are:

"Expected lexical element not found: identifier". - This is when I constrain using GETDATE() - 1

"Unexpected extra token" - This is when I use a dateadd function

Please see the screenshots of this at the links below:

Error Message: http://nukeawhale.home.mindspring.com/error.bmp
Using the ODBC Timestamp: http://nukeawhale.home.mindspring.c...parsed.bmp

Does anyone know of a way to constrain an import through an ODBC connection without using the ODBC timestamp and a specific date?
New Member
New Member

27 Mar 2006 11:54 PM
You should build the query dynamically to yesterday's date using getdate() .

The resultant query would have the fixed date.

Kalman Toth, Database, Data Warehouse and BI Architect
The Best SQL Server 2005 Training in the World

Acceptable Use Policy