Skip to Content

Crystal Reports - SQL Server stored proc datetime parameter format

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 07 at 01:34 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded