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
952 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now