Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
962 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 1200 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 101

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

971 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