How do I add a parameter created in Crystal Reports 8.5 to the SQL from 'Show SQL Query' under Database. If I add {?Test} to restrict records I receive several errors.
Add the parameter to your record selection formula instead, as in:
{table.date} = {?dateparm}
Go to report->edit selection formula->record. If set up correctly in the record selection formula, the parameter should then appear in the Show SQL query.
Any parameters used in the record selection formula do not appear in the Show SQL query. And here lies the problem. I am try to reduce the number of records presented to Crystal to reduce the time the report takes to run.
I disagree. If you design the record selection formula correctly, the results of the parameter selection will appear in the where clause of the SQL query. The parameter selection is made before the SQL statement is generated, so if you selected "TestA" from the parameter list and you had a record selection formula of:
{?test} = {table.test}
...then the where clause would include a where clause like:
WHERE
Table.`Test` = 'TestA'
You might want to check out SynapseVampire's FAQ767-3825 on optimizing SQL pass-through.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.