I have a crosstab query that generates counts for deaths (two categories - primary & secondary causes) within age ranges (generates zeros if none). The query generates the results OK. For example:
PCauseofD SCauseofD
X Y
0to10 11to21 22to30 31to49 50to69 70plus
0 0 5 0 0 1
X Z
0to10 11to21 22to30 31to49 50to69 70plus
3 0 0 3 1 0
However, when I attempt to run the report based on the query, I get the "The Microsoft Jet database engine could not execute the SQL statement because it contains a field that has an invalid data type. (Error 3169)" error. The SQL looks OK and the fact that the query works has me puzzled as to why I am getting this message upon executing the report.
Including the two group by's in the query, I have the following two fields:
group by (col heading) field:
AgeGroup: IIf([Age]<=10,"0to10",IIf([Age]>=11 And [Age]<=21,"11to21",IIf([Age]>=22 And [Age]<=30,"22to30",IIf([Age]>=31 And [Age]<=49,"31to49",IIf([Age]>=50 And [Age]<=69,"50to69",IIf([Age]>=70,"70plus"))))))
expression (value) field:
DummyField: nz(Count("x"),0)
The report has the count fields as follows:
=Nz([0to10],0)
=Nz([11to21],0)
etc...
I am not sure if this is part of the problem. Any help would be appreciated. Thank you.
Paul
PCauseofD SCauseofD
X Y
0to10 11to21 22to30 31to49 50to69 70plus
0 0 5 0 0 1
X Z
0to10 11to21 22to30 31to49 50to69 70plus
3 0 0 3 1 0
However, when I attempt to run the report based on the query, I get the "The Microsoft Jet database engine could not execute the SQL statement because it contains a field that has an invalid data type. (Error 3169)" error. The SQL looks OK and the fact that the query works has me puzzled as to why I am getting this message upon executing the report.
Including the two group by's in the query, I have the following two fields:
group by (col heading) field:
AgeGroup: IIf([Age]<=10,"0to10",IIf([Age]>=11 And [Age]<=21,"11to21",IIf([Age]>=22 And [Age]<=30,"22to30",IIf([Age]>=31 And [Age]<=49,"31to49",IIf([Age]>=50 And [Age]<=69,"50to69",IIf([Age]>=70,"70plus"))))))
expression (value) field:
DummyField: nz(Count("x"),0)
The report has the count fields as follows:
=Nz([0to10],0)
=Nz([11to21],0)
etc...
I am not sure if this is part of the problem. Any help would be appreciated. Thank you.
Paul