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
951 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
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, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

9 Experts available now in Live!

Get 1:1 Help Now