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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I return 2 Tables from a Query? 1

Status
Not open for further replies.

LeonelSanchezJr

Programmer
Joined
Jan 26, 2001
Messages
522
Location
US
I am using SQL 2000 to supply the table for my report developed in Crystal 8.5, however, I am needing to pass a second table.

Can I do this from my stored procedure?

 

Do you need to return columns from two tables in one query or two separate queries? Please provide a sample of your tables and the result you expect. Terry Broadbent
Please review faq183-874.

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
I have one stored procedure which has multiple queries in there. #Temp1 has all of the records within a date range.

#Temp2 has only the specific criteria of records within a date range and comes from #Temp1.

What I am trying to do is show some totals at the end of my report showing the percentage of documents in #Temp2 divided by the number of documents in #Temp1.

Select cDocNum
, cOrigin
, cDestin
, cCust
, dDueDate
, dShipDate
, cDocType
From #Temp1
Order By cOrigin, cDestin, cCust, cDocNum


Select cDocNum
, cOrigin
, cDestin
, cCust
, dDueDate
, dShipDate
, cDocType
From #Temp2
Order By cOrigin, cDestin, cCust, cDocNum
 
Hi

I don't about version 8.5., check the user manual or
the crystal report website.

But in crystal reports(CRP) 7, you cannot pass multiple result to crystal report.

The way i do is
1)Create a temp Result table, which holds the final data,
Add a separate column to the result table to identitfy the data inside the row. Then use that column to filter data at the report
or
2)Create 2 Separate stored procedures(SP), the main SP pulls the detail data and the second sp does the summary totals. Create a main report to display detail data,
use a subreport to display the summary totals


dbtech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top