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
957 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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 …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

751 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