Skip to Content
0

Crystal Reports - SQL Server stored proc datetime parameter format

May 06 at 11:25 PM

52

avatar image

I am trying to create a report over Sql Server Stored Proc that expects two datetime input parameters. However the SP does not accept the input parameter value selected on prompt screen, generating error - 'Incorrect syntax near keyword CONVERT'. SQL generated by report is using Convert function by default

EXECUTE[Projects_findings_summary_date]CONVERT(Datetime,'12/01/2017 00:00:00',120),CONVERT(Datetime,'12/31/2017 12:59:59',120) 
GO

This code generated error on Sql Server Management Studio as well. But works fine if we take the CONVERT function out.

EXECUTE[Projects_findings_summary_date]'12/01/2017 00:00:00','12/31/2017 12:59:59'
GO

Any help resolving this issue is appreciated. We have recently upgraded to Crystal 2016 and SQL Server 2014.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Abhishek Chandan May 07 at 01:34 AM
0

Resolved the issue by using SQL OLE DB Native Driver instead of Microsoft OLE DB provider for SQL Server. Convert is not being generated by Crystal report now.

Share
10 |10000 characters needed characters left characters exceeded