Monday, February 20, 2012

Problem with Date query

Hi!

I'm trying to query an Informix linked server to import data into a SQL database.

The OLE DB Provider is ifxoledbc. I can do general queries such as

Select * from openquery(INFLINKMON, 'SELECT * FROM mydatabase:mytable_t ')

but when I try to add the where clause

Select * from openquery(INFLINKMON, 'SELECT * FROM mydatabase:mytable_t where mydatabase:mytable_t.d_thisdate = "04/12/2006"')

I get the error:

Msg 7321, Level 16, State 2, Line 1

An error occurred while preparing the query "SELECT * FROM mydatabase:mytable_t where mydatabase:mytable_t.d_thisdate="04/12/2006"" for execution against OLE DB provider "Ifxoledbc" for linked server "INFLINKMON".

Does anyone know what I am doing wrong? I can do a where query on other fields but not on date.

Thanks for any input that you can give.

Does the query run on the native system, without executing it through the linked server ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver0205.de
|||

Thanks for responding...

Yes, the query runs on the native system, unix, by typing the select query on the command line exactly the same as the select in single quotes SELECT * FROM mydatabase:mytable_t where mydatabase:mytable_t.d_thisdate = "04/12/2006" .

Thanks Again for any input!

No comments:

Post a Comment