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!

Parameters

Status
Not open for further replies.

clapag22

Programmer
Mar 9, 2001
239
US
Help! I cannot get parameters to work!

I have an SQL query which I put into the Crystal SQL Designer. It's basically information about medical cases.

I need a parameter that will allow me to type in a specific case number and only have data returned for that one case. When I go to Edit.. Parameter Field and create a new one, the Browse Field drop down box is empty. I am assuming what this box is supposed to do is link a field in the query to the parameter value.

Does anyone have any clue why this is not working? Do I need to enter something in the query itself (ie; where case_number = :case_numb) (or something to that affect).

Thanks in Advance.
Craig
 
You don't need those drop downs. All they do is let you select a literal value as a default. They do not tell the query how to use the parameter or what field to associate it with.

Once you have named a parameter you have to add a line to your where clause that is like this:

AND Customer.`Region` = '{?reg}'

depending on your SQL syntax. The last item should be the name of your parameter, which is always in curly braces, with a Question mark added by the program.

Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
That did it.

Thanks (once again) for your assistance.

You must admit that parameters are not explained all that clearly anywhere in the documentation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top