Author |
Message |
cfuller510
Newbie
Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
cfuller510
Newbie
Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
|
Posted: 06 Jul 2011 at 4:54am |
There are fields used within the report and in the formulas from all tables/views/procedure.
|
IP Logged |
|
sharona
Senior Member
Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
|
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 Logged |
|
cfuller510
Newbie
Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 06 Jul 2011 at 6:30am |
Hmmm,
Not sure why this is. You are not using sub reports correct?
|
IP Logged |
|
cfuller510
Newbie
Joined: 06 Jul 2011
Online Status: Offline
Posts: 4
|
Posted: 06 Jul 2011 at 6:37am |
Correct, there are no sub-reports used.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
sharona
Senior Member
Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
|
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 Logged |
|
|