Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Crystal Generates Incorrect SQL Statements Post Reply Post New Topic
Author Message
SDB2
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Online Status: Offline
Posts: 17
Quote SDB2 Replybullet Topic: Crystal Generates Incorrect SQL Statements
    Posted: 16 Jul 2009 at 1:11pm
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
IP IP Logged
SDB2
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Online Status: Offline
Posts: 17
Quote SDB2 Replybullet Posted: 17 Jul 2009 at 8:48am
Update: I did some more testing and this same problem occurs only with date time paramters.
IP IP Logged
SDB2
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Online Status: Offline
Posts: 17
Quote SDB2 Replybullet Posted: 17 Jul 2009 at 9:28am
Problem solved: Switched from SQL Native Client to SQL Client driver. SQL now runs beautifully. Hope this helps someone else down the road.
IP IP Logged
ayman
Newbie
Newbie
Avatar

Joined: 08 Jul 2015
Location: Egypt
Online Status: Offline
Posts: 1
Quote ayman Replybullet Posted: 11 Jul 2015 at 9:39pm
sorry, but what do you mean by "SQL Client driver"

Edited by ayman - 11 Jul 2015 at 9:49pm
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.