gdanalakshmi
01-22-2003, 10:47 AM
I have a parameter query (BaseQry) that takes the parameters from the Form.
THen I built a crosstab query using BaseQry. But when I try to run the crosstab, i get the following error -
Microsoft JEt Engine doesnot recognise [Forms]![ReportMenu]![StartDate] as a valid expression.
But if i hardcode the dates in the BaseQry and then run the crosstab query, i get the expected result.
How do i dynamically specify the parameter for the BAseQry without getting the error
Sohaila Taravati
01-22-2003, 11:20 AM
Try making another query out of your crosstab and the baseQry and take your critaria out of your baseQry and put it in your new one. That should do the trick:)
You have to define the Parameters for the crosstab
ie. Forms!MyForm!MyField Date/Time
gdanalakshmi
01-22-2003, 05:10 PM
If I move the criteria to the crosstab query then my query will be lot slower since it is not limited by the criteria.
gdanalakshmi
01-22-2003, 05:18 PM
I tried moving the parameter to the crosstab, but still i am getting the same Jet engine error??
Pat Hartman
01-22-2003, 05:41 PM
Put the criteria in whichever query it will be most effective but Rich gave you the solution to the error. Crosstabs are very sensitive and require that any parameters be specifically declared and it extends this requirement to any subqueries.
gdanalakshmi
01-22-2003, 05:56 PM
Thanks for your reply. I just figured it out what Rich suggested.
It is working when I specify the type of the parameters in the crosstab.
rich.barry
01-22-2003, 07:15 PM
Brilliant.
I just posted the same problem, but then thought I'd better read the other thread titled "CrossTab".
Wadda you know...quick fix within. (and a fast Edit..Delete so as not to appear an idiot).
For any one with the knowledge, when should one declare parameters for a query?
Does it improve the speed or anything else by doing so?
Richard