datetime and datetime2 data types are incompatible with the add operator
Posted: Wed 20 Oct 2021 14:04
Hello,
I am trying to execute a query that adds a datetime. The query is like this:
UPDATE MY_TABLE
SET SCHEDULEDATE = :MYDATETIME_PARAM + SCHEDULEDATE
The field SCHEDULEDATE and the param MYDATETIME_PARAM are datetime type. This query fails if I connect using direct mode with the error "datetime and datetime2 data types are incompatible with the add operator" but it is working if I connect using OleDB mode.
Moreover, I tested with dbexpsda40.dll version 7.2.4.0 and with this old version is working. I tested version 8.1.4.0 and version 9.0.1.0 and it fails. I tested compiling the code with 32 bits and 64 bits over Windows 10, with the same result. I am using Delphi XE7.
Best regards,
Mario
I am trying to execute a query that adds a datetime. The query is like this:
UPDATE MY_TABLE
SET SCHEDULEDATE = :MYDATETIME_PARAM + SCHEDULEDATE
The field SCHEDULEDATE and the param MYDATETIME_PARAM are datetime type. This query fails if I connect using direct mode with the error "datetime and datetime2 data types are incompatible with the add operator" but it is working if I connect using OleDB mode.
Moreover, I tested with dbexpsda40.dll version 7.2.4.0 and with this old version is working. I tested version 8.1.4.0 and version 9.0.1.0 and it fails. I tested compiling the code with 32 bits and 64 bits over Windows 10, with the same result. I am using Delphi XE7.
Best regards,
Mario