Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to use multiple query's??

Status
Not open for further replies.

nickwooly

Programmer
Jul 3, 2001
4
US
Is there a way in CR 8.5 to query the results from one query to generate a report. Here's my problem: I have an assignments table that contains a user, their assignment begin and end dates (among other irrevelvant data). The end result (my objective) needs to be a list of users that had their first assignment date in a certain month. I can run a query and group the results by user name and assignment begin date. That gives me each users first assignment. Then if I run another query upon those results I can get the list I need. My problem is how can I combine these 2 queries in CR 8.5?? Or how can I run the first one, then query those results with the second?? Any help would be appreciated!



 
Against what database are you running your queries?
 
Would it be possible to create a temp table off of the first query results, then run your second query against this table? If you only need the results of the second (and if temp tables are possible on AS400) this could be an answer. If you need both resultsets and are using ADO and VB you can play around with running one procedure that contains two separate queries, the results or which will be placed in the recordset. I believe the first recordset is the primary. You can access the second by using the adoRecorset.NextRecordSet method.

Don't know if this is any help.

O.
 
I believe that if I create a temp file holding the results of the first query, and then run the second query against the temp file, as you mentioned, it will work. I was just hoping to find an easier way with Crystal Reports to accomplish my goal. Thanks for you help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top