INeedAccessHelp
MIS
Hello all! I'm having a problem with a crosstab query I've created. The query in SQL view is as follows:
TRANSFORM Sum([Casesm1]+[Casesm2]+[Casesm3]+[Casesm4]+[Casesm5]+[Casesm6]+[Casesm7]
+[Casesm8]+[Casesm9]+[Casesm10]+[Casesm11])/Sum([Pvol1]+[Pvol2]+[Pvol3]+
[Pvol4]+[Pvol5]+[Pvol6]+[Pvol7]+[Pvol8]+[Pvol9]+[Pvol10]+[Pvol11]) AS Efficiency
SELECT tblVolume.Dayofweek, tblVolume.EntryDate, tblVolume.Shift, Sum([Efficiency]) AS [Efficiency Total]
FROM tblVolume
WHERE (((tblVolume.Line)="001" Or (tblVolume.Line)="002" Or (tblVolume.Line)="003" Or (tblVolume.Line)="004" Or (tblVolume.Line)="005" Or (tblVolume.Line)="006" Or (tblVolume.Line)="007" Or (tblVolume.Line)="008" Or (tblVolume.Line)="009" Or (tblVolume.Line)="010" Or (tblVolume.Line)="011" Or (tblVolume.Line)="012" Or (tblVolume.Line)="015") AND ((tblVolume.EntryDate) Between [Forms]![frmReports]![FromDate] And [Forms]![frmReports]![ToDate]))
GROUP BY tblVolume.Dayofweek, tblVolume.EntryDate, tblVolume.Shift
ORDER BY tblVolume.EntryDate, tblVolume.Shift
PIVOT tblVolume.Line In ("001","002","003","004","005","006","007","008","009","010","011",
"012","015");
The error I'm getting is:
This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables.
FYI - When I remove the "/Sum([Pvol1]+[Pvol2]+[Pvol3]+[Pvol4]+[Pvol5]+[Pvol6]+[Pvol7]+[Pvol8]+
[Pvol9]+[Pvol10]+[Pvol11])" part of Efficiency, the query returns the correct results.
Thanks in advance for your help/answers/comments.
--Rob
TRANSFORM Sum([Casesm1]+[Casesm2]+[Casesm3]+[Casesm4]+[Casesm5]+[Casesm6]+[Casesm7]
+[Casesm8]+[Casesm9]+[Casesm10]+[Casesm11])/Sum([Pvol1]+[Pvol2]+[Pvol3]+
[Pvol4]+[Pvol5]+[Pvol6]+[Pvol7]+[Pvol8]+[Pvol9]+[Pvol10]+[Pvol11]) AS Efficiency
SELECT tblVolume.Dayofweek, tblVolume.EntryDate, tblVolume.Shift, Sum([Efficiency]) AS [Efficiency Total]
FROM tblVolume
WHERE (((tblVolume.Line)="001" Or (tblVolume.Line)="002" Or (tblVolume.Line)="003" Or (tblVolume.Line)="004" Or (tblVolume.Line)="005" Or (tblVolume.Line)="006" Or (tblVolume.Line)="007" Or (tblVolume.Line)="008" Or (tblVolume.Line)="009" Or (tblVolume.Line)="010" Or (tblVolume.Line)="011" Or (tblVolume.Line)="012" Or (tblVolume.Line)="015") AND ((tblVolume.EntryDate) Between [Forms]![frmReports]![FromDate] And [Forms]![frmReports]![ToDate]))
GROUP BY tblVolume.Dayofweek, tblVolume.EntryDate, tblVolume.Shift
ORDER BY tblVolume.EntryDate, tblVolume.Shift
PIVOT tblVolume.Line In ("001","002","003","004","005","006","007","008","009","010","011",
"012","015");
The error I'm getting is:
This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables.
FYI - When I remove the "/Sum([Pvol1]+[Pvol2]+[Pvol3]+[Pvol4]+[Pvol5]+[Pvol6]+[Pvol7]+[Pvol8]+
[Pvol9]+[Pvol10]+[Pvol11])" part of Efficiency, the query returns the correct results.
Thanks in advance for your help/answers/comments.
--Rob