I wrote a stored proceedure that selects the top 5 most run reports in our system.
The query runs fine in SQL studio and if a co-worker logs in and puts it into a report, everything goes fine. (We are logging on to the same computer. Same version of crystal, etc.)
When I try to select the stored proceedure, i get the following error:
Query Engine Error: 'ADO Error Code: 0x80040e14
Source: Microsoft SQL Native Client
Description: Incorrect syntax near the keyword 'CONVERT'.
SQL State: 42000
Native Error: 156'
(I do not use 'CONVERT' in my query.)
I noticed that in my version of crystal the sql query reads like this:
"HDSLive"."dbo"."HDS_SP_CR_Top5Reports";1 CONVERT(DATETIME, '2009-07-01 00:00:00', 120), CONVERT(DATETIME, '2009-07-15 00:00:00', 120)
When my coworker runs the report, crystal generates SQL without the 'CONVERT' operators.
Is there a setting that governs SQL generation? Why would my co-worker's SQL be different than mine?
Edited by SDB2 - 16 Jul 2009 at 1:12pm