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

How to use .qry parameters in CR report?

Status
Not open for further replies.

knzy

Programmer
Jan 25, 2002
63
0
0
CA
Hi! Good morning,

I am using .qry file in a report as the database. In the .qry file, I set up a parameter to get the start date for a database field. The problem is - when I run the CR report, it doesn't ask for any input for the .qry parameter. Is it right? Can I pass values from CR to .qry?

Regards,
Knzy
 
Hi,

Maybe i don't understand but why dont you use crystal parameters?
 
There, you have me. Problem is I designed the report when I was quite new to CR. Now, I don't want to change the database source from .qry file to CR SQL query, becuase it is as time-consuming as to build a new report from scratch. So I would like to find a way to input the .qry parameters from CR report - if it is possible.

Regard,
Knzy

 
When you save the query in the CR SQL Designer, be sure that "Save Data With Query" in the "File" menu is NOT checked. If the .qry file contains saved data, the report based on that .qry does not prompt for a parameter value.
 
Thanks Rogar, I think this is the answer. Now I am able to input the .qry parameters from CR.

The further question is - how can I set dynamic default value for the .qry parameters? Such as the first day of last full month. Is it possible?

Regards,
Knzy
 
I don't know any way to do dynamic parameters. You can use another parameter to override the date parameter with a value based on current date but the SQL can get very complex. The date parameter in the .qry must contain a date value if it is part of the SQL, even if it is in the unexecuted side of an if..then..else clause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top