Hello great group,
I'm using Access97 & Win95
I have a report that is based on a crosstab query. I have no problem to get the report with ALL records. However, I'm trying to get a date range so the report will print from/to specific dates and that's where I'm having problems.
The SQL in the crosstab query (named List Objectives_Crosstab) is:
TRANSFORM Count([To Do].AutoNum) AS CountOfAutoNum
SELECT [To Do].Objective
FROM [To Do]
WHERE ((([To Do].Completed) Between [Start Date] And [End Date]))
GROUP BY [To Do].Objective
PIVOT [To Do].Goal;
The Report's Record Source points to "List Objectives_Crosstab" query above. Now, when I run the report, I get a message:
"The Microsoft Jet database engine does not recognize '[Start Date]' as valid field name or expression". The same error comes up when I tried to run the query from the query design window (Datasheet View).
So I added to the PARAMETER box the Start Date and End Date with Date/Time data type and the SQL code looks like this:
PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Count([To Do].AutoNum) AS CountOfAutoNum
SELECT [To Do].Objective
FROM [To Do]
WHERE ((([To Do].Completed) Between [Start Date] And [End Date]))
GROUP BY [To Do].Objective
PIVOT [To Do].Goal;
When I re-run it now from the query design window (Datasheet View), I get a prompt to enter Start Date and End Date and all is fine. However, when I try to run it from the Reports Tab (Preview), I get the prompt to enter the Start Date and End Date but after that I get a new error:
"The Microsoft Jet database engine does not recognize 'List Objectives-Crosstab' as valid field name or expression"
What am I doing wrong?
Thanks much for any help! -Ami
I'm using Access97 & Win95
I have a report that is based on a crosstab query. I have no problem to get the report with ALL records. However, I'm trying to get a date range so the report will print from/to specific dates and that's where I'm having problems.
The SQL in the crosstab query (named List Objectives_Crosstab) is:
TRANSFORM Count([To Do].AutoNum) AS CountOfAutoNum
SELECT [To Do].Objective
FROM [To Do]
WHERE ((([To Do].Completed) Between [Start Date] And [End Date]))
GROUP BY [To Do].Objective
PIVOT [To Do].Goal;
The Report's Record Source points to "List Objectives_Crosstab" query above. Now, when I run the report, I get a message:
"The Microsoft Jet database engine does not recognize '[Start Date]' as valid field name or expression". The same error comes up when I tried to run the query from the query design window (Datasheet View).
So I added to the PARAMETER box the Start Date and End Date with Date/Time data type and the SQL code looks like this:
PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Count([To Do].AutoNum) AS CountOfAutoNum
SELECT [To Do].Objective
FROM [To Do]
WHERE ((([To Do].Completed) Between [Start Date] And [End Date]))
GROUP BY [To Do].Objective
PIVOT [To Do].Goal;
When I re-run it now from the query design window (Datasheet View), I get a prompt to enter Start Date and End Date and all is fine. However, when I try to run it from the Reports Tab (Preview), I get the prompt to enter the Start Date and End Date but after that I get a new error:
"The Microsoft Jet database engine does not recognize 'List Objectives-Crosstab' as valid field name or expression"
What am I doing wrong?
Thanks much for any help! -Ami