Hi all,
I posted something similar a couple of weeks ago but still no joy...
I have a linked server in SQL to Pervase DB.
When I run a distributed select * statement to the linked server, it fails when the results reach the first datetime record that contains a 0 (Zero).
The pervasive DB design contains some data types of 'date' and they are to be allowed contain a valid date or a zero.I cannot change the design of this DB.
I know its the zero in the date field causing problems because When I run a select top 3493 on the DB I get back the date row ok...
As soon as I go one higher 3494. I get the error
"Error converting data type DBTYPE_DBDATE to datetime"
Is there some syntax to check that the data is a real date and if not set to Null.
I know there is an 'isdate' function but I am not sure of the syntax..
Here is an example
SELECT top 3493 *
From OPENQUERY(sbase_local, 'select date_booked from jobs')
retuns 3493 columns of 2002-02-21 00:00:00.000
if I use
SELECT top 3494 *
From OPENQUERY(sbase_local, 'select date_booked from jobs')
I get the "Error converting data type DBTYPE_DBDATE to datetime"
The record 3494 is the first record the query hits where date_booked contains a zero and not a date.
Any Help appretiated
Ray
I posted something similar a couple of weeks ago but still no joy...
I have a linked server in SQL to Pervase DB.
When I run a distributed select * statement to the linked server, it fails when the results reach the first datetime record that contains a 0 (Zero).
The pervasive DB design contains some data types of 'date' and they are to be allowed contain a valid date or a zero.I cannot change the design of this DB.
I know its the zero in the date field causing problems because When I run a select top 3493 on the DB I get back the date row ok...
As soon as I go one higher 3494. I get the error
"Error converting data type DBTYPE_DBDATE to datetime"
Is there some syntax to check that the data is a real date and if not set to Null.
I know there is an 'isdate' function but I am not sure of the syntax..
Here is an example
SELECT top 3493 *
From OPENQUERY(sbase_local, 'select date_booked from jobs')
retuns 3493 columns of 2002-02-21 00:00:00.000
if I use
SELECT top 3494 *
From OPENQUERY(sbase_local, 'select date_booked from jobs')
I get the "Error converting data type DBTYPE_DBDATE to datetime"
The record 3494 is the first record the query hits where date_booked contains a zero and not a date.
Any Help appretiated
Ray