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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
woks fo me - thanks, mlmcc :)
Glad i could help
mlmcc
mlmcc