In a message dated 00-02-11 14:50:20 EST, you write:
I am creating a query that involves a subquery (no problem - I know how to
do that). But I want my subquery to be a combination (intersection) of 2 other queries. Business Objects greys out the “Combine Queries” button in the Query Panel when you are creating the subquery, so it won’t let me do it. Does anyone have any suggestions?
I am using Business Objects 4.1.3 and MS Access 97.
You cannot, unfortunately, use the Combine Query feature in a sub-query in BusinessObjects. However, there is a reason for this (other than they just didn’t feel like programming that feature ).
In MS Access you cannot do an Intersection in the database. MS Access only supports Union. Because of that, an Intersection or Minus operation is actually performed on the client.
You can verify this easily: create a query using Island Resorts that does a Union of Customers and Salespeople. Examine the SQL code by pressing the SQL button on the query panel. You will see one piece of SQL code generated with a UNION in the middle.
Now change your combined query operation from Union to Intersection and examine the query. There are now TWO queries. Each query data set will be downloaded to the client where the Intersection operation is performed.
The same thing happens with a Minus… most databases do not support this feature.
Now consider a sub-query: the sub-query is run first, and the resulting data set is used as criteria for the outer (main) query. In order to use a sub-query with an intersection against MS Access (or many other databases) here is what would have to happen:
- Run the first half of the Intersection query, download the data set. 2. Run the next half of the Intersection query, download the data set. 3. Perform the Intersection on the two data sets. 4. Upload the resulting data set as criteria for the final phase: the main query.
Step 4 is, unfortunately, not possible. For that reason the combined query option is not available in a sub-query.
Regards,
Dave Rathbun
Integra Solutions
www.islink.com
Listserv Archives (BOB member since 2002-06-25)