Solved

In Crystal Reports, then Database Expert, under Current Connection, then Add Command, then I drop SQL that works in

Posted on 2008-10-29
3
956 Views
Last Modified: 2011-10-19
I have a Crystal Report where I am creating my own SQL based on MS Access data as source.  I have had success creating and running these SQL statements.  Where I am running into problem is using already created SQL statements in Crystal that are all separate Commands (i.e. Command, Command_1, etc.).  Each of these Commands that represent separate SQL statements is listed under Database Fields on right hand side of Crystal.

How do I properly reference these Commands in new Commands I am creating.

Example:

SELECT DISTINCT x.GfCnBio_Import_ID
FROM
(
SELECT DISTINCT a.GfCnBio_Import_ID
FROM "Command" a
UNION ALL
SELECT DISTINCT b.GfCnBio_Import_ID
FROM "Command_1" b
) AS x;

I want to create a third Command (SQL) that makes use of Command and Command_1.

Please help.
screenshot.JPG
0
Comment
Question by:rporter45
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 300 total points
ID: 22832501
I don't believe CR allows the use of a command as the source for another command.  A command is submitted to the database for execution so the database is not going to know what is meant by another command name.

Obviuopusly you could do this sort of structure within the database if you have design access.  Otherwise you are faced with a very complex sql command if you try to do it all in CR.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22854255
Agree.  If it is possible at all it would be done by building another command and storing all the commands in the repository.

mlmcc
0
 
LVL 26

Assisted Solution

by:Kurt Reinhardt
Kurt Reinhardt earned 200 total points
ID: 22855762
peter57r is correct - you can't base a command on another command.  Each command is executed entirely on it's own. You also don't want to use multiple commands in any report (with very few exceptions), especially if they're linked.  Once again, that's because each command must be executed fully first.  So, if you link commands each of them must execute before the link can be processed, which means very, very poor performance.

In your case, you need to reference the actual SQL from within the various commands within one single command.  Depending on the complexity of your Commands, this can get a little hairy, as perter mentioned.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to pass a value from vb.net 2013 form to a Sap Crystal Reports 4 116
Join issues with Crystal Report 10 80
Possibly a grouping issue? 7 36
Analyze Shared Variable? 7 28
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question