Link to home
Start Free TrialLog in
Avatar of mixxie
mixxie

asked on

Pass Query Parameter to Subquery

Hello, experts!  I have a question regarding Crystal Reports XI.  I have a report that pulls data from 3 different tables.  One table returns 'header' type of data (one row), while the other two tables return 'detail' data (multiple rows).  

What I've done is created a report using

SELECT * FROM my_header_table WHERE order = {?order} (for example)

and I have two subreports:

SELECT * FROM my_detail_table1 (for example)
SELECT * FROM my_detail_table2 (for example)

These are linked to the main report through subreport links. This takes an exceedingly long time to run.  If I change my subreports to:

SELECT * FROM my_detail_table1 WHERE order = {?order}  

(with no subreport links) then the report runs much more quickly.  The problem is that the user must then enter the same number 3 times.  Can I pass the parameter from the header table to the queries in the subreports?

Thanks!
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
woks fo me - thanks, mlmcc :)
Avatar of Mike McCracken
Mike McCracken

Glad i could help

mlmcc