Print Page | Close Window

Union Clause

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1560
Printed Date: 01 May 2024 at 11:19pm


Topic: Union Clause
Posted By: STata
Subject: Union Clause
Date Posted: 23 Oct 2007 at 1:49pm
How do I use union clause in Crystal. I know exactly what I want and how to do this using sql but when I go through the Crystal Reports GUI, I cannot figure out how to do a union. I tried editing the SQL from Database, show SQL but it does let me edit it. What am I missing? Cry



Replies:
Posted By: BrianBischof
Date Posted: 23 Oct 2007 at 2:32pm
Yes, CR lets you do UNION (I discuss it in Chapter 11 of my new book). In the Database Expert dialog box, look for Add Command option and click on it to add a new command object. This is where you type in your custom SQL statements with the UNION clause.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: STata
Date Posted: 24 Oct 2007 at 10:33am

Thank you, but I don't see the 'Add command option' . When I go to the database expert all I have is 'Data' and 'Link' tabs. I have Crystal Reports X1 installed. Please help.



Posted By: BrianBischof
Date Posted: 24 Oct 2007 at 10:40am
That usually happens when you don't have a database that is 100% compatible with CR. Are you using MySql or something? Also, some databases don't have this option when you are connecting with OLE DB, but the ODBC driver will have it. So check to see if you are using ODBC connectivity.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: STata
Date Posted: 24 Oct 2007 at 10:49am
I am connecting to an Oracle database on a remote unix server. Is that an issue?


Posted By: BrianBischof
Date Posted: 25 Oct 2007 at 12:05pm
I don't know anything about Oracle, but this is most likely the problem. Check for updated ODBC drivers if possible. But you're right - this scenario may not work at all.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: JERL
Date Posted: 02 Nov 2007 at 7:25am

I am attempting to use UNION clause in CR too. Have you had any luck since your post on Oct 25th, 2007?



Posted By: STata
Date Posted: 02 Nov 2007 at 7:50am
No, I have not had any luck. To be honest, I have not looked too much into it but I don't see the 'Add Command Option' that Brian mentioned in this thread.


Posted By: JERL
Date Posted: 02 Nov 2007 at 7:56am
I am connecting to oracle as well. If I come up with a solution I'll post it.


Posted By: wattsjr
Date Posted: 06 Nov 2007 at 10:39am
Hi STata,
 
I may be speaking out of turn here, but I was able to find the "Add Command" that Brian was talking about.
 
It is under the Data tab, on the left hand side:
 
+Project Data
....
+History
 
Expand "History" (click on the "+") and login to your data source name when it prompts you. 
 
When the "History" expands, the first entry under the data source name should be the "Add Command" option.
 
If you've tried all of this and it still wasn't there, then please 'excuse the ring', I was just hoping that it was something that was hard to find.
 
Regards, 


-------------
-jrw


Posted By: STata
Date Posted: 07 Nov 2007 at 8:38am
Thank you. I do see the "Add Command" now. I am now trying to see how to make it work. Thanks again for pointing me in the right direction.



Print Page | Close Window