Page 1 of 1

SQL Server 2008 and time fields

Posted: Mon 11 Jan 2010 14:05
by hughespa
Hi,

I'm using UniDAC, D2010, SQL Server 2008 (Express)

Given a table with the following fields:

JOBDATE DATE,
STARTTIME TIME(0) [ also same with TIME(7) ]
DURATION FLOAT
CLINO INTEGER

and an update statement (shown in DBMonitor) of:

UPDATE VISIT
SET
DURATION = ?
WHERE
JOBDATE = ? AND STARTTIME = ? AND DURATION = ? AND CLINO = ?

where the param values are:

JOBDATE IN Date 21/01/2010
STARTTIME IN Time 08:00:00
DURATION IN Float 0.5
CLINO IN Integer 123456

I get the following error:

The data types time and datetime2 are incompatible in the equal to operator.

What can I do to fix this please?

Is this also related to my earlier post regarding table filter on time fields? I still have no solution to that yet.

Thanks in advance.

Regards, Paul.

Posted: Tue 12 Jan 2010 08:40
by Dimon
Please make sure that you have SQL Native Client 2008 installed on your client PC.
And check that the TMSConnection.Options.Provider property is set to the prNativeClient value.

Posted: Tue 12 Jan 2010 09:25
by hughespa
Hi Dimon,

The Native client (SQL Server Native CLient 10.0) is definitely installed on this development PC.

The Connection.Options.OLEDBProvider was set to prAuto.

However, changing it to prNativeClient doesn't help.

I still get the same error as before.

Regards, Paul.

Posted: Wed 13 Jan 2010 13:00
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.