Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Data Connectivity
Message Icon Topic: SQL Query Post Reply Post New Topic
Author Message
cfuller510
Newbie
Newbie


Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
Quote cfuller510 Replybullet Topic: SQL Query
    Posted: 06 Jul 2011 at 3:54am
I have a report that is using 2 tables, 3 views and 1 stored procedure.  I need to be able to document the SQL Query behind the report, but when I open the Show SQL Query box, only one of the tables is displayed as being used.  However, when I go to the Database Expert, all the tables are listed and showed as linking in the Links tab.  Is there a reason why they are not showin in the SQL Query box?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jul 2011 at 4:50am
if you are not enforcing joins in crystal and are not using any fields from any of these other tables they are not part of the query.
IP IP Logged
cfuller510
Newbie
Newbie


Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
Quote cfuller510 Replybullet Posted: 06 Jul 2011 at 4:54am

There are fields used within the report and in the formulas from all tables/views/procedure. 

IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 06 Jul 2011 at 4:58am
you know you cant join tables to views and sp in one report in crystal youll get an error. you need to either create a sub report to pull the view data
and a sub for the sp. then join them on the link you were going to in the main report.
sharona
IP IP Logged
cfuller510
Newbie
Newbie


Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
Quote cfuller510 Replybullet Posted: 06 Jul 2011 at 5:01am
It does run the way it is set up.  This is a report that was created by someone else, so I'm not sure if there is anything else behind the report. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jul 2011 at 6:30am

Hmmm,

Not sure why this is. You are not using sub reports correct?
IP IP Logged
cfuller510
Newbie
Newbie


Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
Quote cfuller510 Replybullet Posted: 06 Jul 2011 at 6:37am
Correct, there are no sub-reports used. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jul 2011 at 6:41am
odd.
you can verify the DB, run the report, refresh the repotr and everything still works but the Database >Show SQL Query is still omitting everyhing but one table?
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 06 Jul 2011 at 6:52am
if you dont have the joins it will only pick up the first table it sees
and i think you should re design the report, it is probably cumbersome because with out joins it pulls all the records from every table, view, sp it uses.
sharona
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.031 seconds.