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

Parameters in SQL-Query

Status
Not open for further replies.

OliverKulbach

Programmer
Dec 5, 2000
39
0
0
DE
Hi everybody,
I'm using CR8 and have the following problem. First I crated a report with the "Select Expert". Then I found that I doesn't get the data I wanted and changed the SQL-Query manually in the "Show SQL-Query". After that it worked fine. Now I thought it would be better to use a parameter-field in the query. I changed the SQL-Query from

WHERE
adr_t.login_verantw = 'MG' ................
to
WHERE
adr_t.login_verantw = '{?Sales}' ..............

but when I start the report I don't get asked for the parameter. Then I thought ok, put it in the "Select Expert" and after that I get prompted for the parameter-field. Unfortunatly it looks like that the data will not be handed over to the SQL-Query as it returns no data. Can anybody explain that to me or has an idea what the mistake is?

Thanks
Oliver
 
Oliver,

The Select Expert and modifications to the SQL Statement are an either/or action - You can either use the select expert, or modify the SQL, not both. Whichever action you do overwrites the other. What you seem to be trying to do is put a complex SQL query directly into the report, and then filter these rows by a Parameter.

One way around this is to create a VIEW in your underlying database. This view should be constructed as per your complicated SQL Query, but without any filtering on your parameter field. Your report will then run against this view, and using the select expert, you can introduce the filter on the paramter field.

Regards, Chris.

Chris Lawton
Chris.Lawton@GoldMine.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top