Hi,
running db2 v8.2 fp9 on Windows when executing following SQL:
Code:
select
col1, col2
from
mytable
WHERE mydate_column BETWEEN CURRENT DATE - 6 MONTHS AND CURRENT DATE - 1 DAY
from DB2CMD SQL runs successfully.
But when I run the same SQL with ODBC driver I get error:
ODBC Layer Error: [01506] ==> [[IBM][CLI Driver][DB2/NT] SQLSTATE 01506: An adjustment was made to a DATE or TIMESTAMP value to correct an invalid date resulting from an arithmetic operation.
The most strange thing is this SQL is in production environment for more then one year and there was no problem at all.
I have temporally changed the SQL to remove "current date" and put fixed values like:
Code:
select
col1, col2
from
mytable
WHERE mydate_column BETWEEN '30.04.2008' AND '30.10.2008'
and this SQL works fine using ODBC connection.
It looks like there is some kind of bug... Is there any command to clear date registries or something like that. I have also tried to reboot computer and problem persists.
What should I do to solve the problem?
Regards,
Grofaty