Hi, Aleš -
1. What error message are you getting? There are several error conditions that produce SQLSTATE 22007, according to the online documentation I've looked at.
2. What is your SQLCA.DBParm setting? Are you including DateFormat and/or DateTimeFormat in DBParm?
3. How would you specify the date value in a SQL SELECT statement if you entered it into SQL Server Management Studio?
4. The SQL you posted showing the SELECT statement when using the MSOLEDBSQL driver looks syntactically correct. Have you tried copy/pasting that same SELECT statement into SQL Server Management Studio to see if it executes in your environment?
Best regards, John
Suggestions ...
1) Try Auto Commit ON...
SQLCA.AutoCommit=TRUE
// If that does not work ....
2 Try another Isolation level ...
SQLCA.Lock ='RU' // as an example
HTH
Regards ... Chris