This is a Crystal Reports issue.
Please see:
https://answers.sap.com/questions/8779045/server-native-client-100-incorrect-syntex-datetime.html
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
Having problem with MSOLEDBSQL driver. I am using Crystal reports to call SQL Server 2016/19 stored procedures.
When a stored procedure with Datetime parameter is called, it is putting the parameter as CONVERT(DATETIME, '2018-06-01 00:00:00', 120) and fails with Database vendor Error 156, Incorrect syntax near the keyword 'CONVERT'.
With the older SQLNCLI11 driver, the same parameter was being called as {ts '2018-06-01 00:00:00'} and worked perfectly fine.
This is a Crystal Reports issue.
Please see:
https://answers.sap.com/questions/8779045/server-native-client-100-incorrect-syntex-datetime.html
I would use Profiler to see what is actually being sent to SQL Server. You will need to include the events SP:StmtStarting.
I would guess that Crystal is doing something behind the scenes.
Hi @Gond, Janmejay ,
It seems it is a known issue in Crystal Report. Please refer to using MSOLEDBSQL for Crystal Reports and 'Incorrect syntax near keyword CONVERT' for more details.
And according to the above similar issue, it is recommended to use SQL Native client 11 in report.
Best Regards,
Amelia
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.