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

Using data from a query on one connection in a Parameter

Status
Not open for further replies.

dnessmith

Programmer
Jul 5, 2011
3
US
In Crystal Reports XI, is there a way to use the selected info from one query that is on one connection in another query's (on another connection) FROM statement as a parameter? Remember these are 2 different Connections.

Example:
First Query:

SELECT
SUBSTR(stvterm_code,3,4) AS term
FROM
stvterm
WHERE
SYSDATE BETWEEN stvterm_start_date AND stvterm_end_date
---------------------------------------------------------------
Second Query
SELECT
*
FROM
yen{?term}
 
If you make the first query one report and put the second query in a subreport you should be able to pass the value from the main report to a subreport parameter, and then into the command of the subreport. I did a case study for a somewhat similar problem here:


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Could not get it to work but that is surely due to my inexperience. I have decided to force the user to enter the parameter themselves instead of making the report automatic. Thank you for the response, Ill keep it in mind as I get more experience in the hopes of being able to use it later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top