oleidreiter
New member
- Local time
- Today, 01:41
- Joined
- Nov 3, 2011
- Messages
- 1
I have a crosstab query that either doesn't recognize the parameter (if it is not also in the Parameter list) or claims the the "Expression is typed incorrectly, or is too complex". This query is very simply pulling data from two tables with four restricting fields one of which is the parameter. The parameter restricts a year designator which is store as a string like "2010, 2011, etc. I have tried seperating the where statements into a seperate select query with the four fields I need, but the crosstab chokes on it the same way each time. The queries run fine as a select only.
The SQL for the combine crosstab is:
TRANSFORM Count(tblNonconformanceData.SystemID) AS CountOfSystemID
SELECT tblPlantInfo.strDivision, tblPlantInfo.strBusinessUnit, tblNonconformanceData.strPlant
FROM tblNonconformanceData LEFT JOIN tblPlantInfo ON tblNonconformanceData.strPlant = tblPlantInfo.strPlant
WHERE (((tblNonconformanceData.strQNType)="Q1") AND ((tblNonconformanceData.SystemReportYear)=[Enter Year]) AND ((tblNonconformanceData.ysnDuplicate)<>True) AND ((tblNonconformanceData.strCategory) Is Not Null))
GROUP BY tblPlantInfo.strDivision, tblPlantInfo.strBusinessUnit, tblNonconformanceData.strPlant, tblNonconformanceData.ysnDuplicate
ORDER BY tblPlantInfo.strDivision, tblPlantInfo.strBusinessUnit
PIVOT tblNonconformanceData.SystemReportMonth;
I have even rewritten the query from scratch as one, in pieces, all to no avail.
The only type of fields retrieved are strings and a boolean. A count of a string field is used for the pivot value.
Anyone with insight into this type of occurrence, I would appreciate your suggestions.
Thanks you.
The SQL for the combine crosstab is:
TRANSFORM Count(tblNonconformanceData.SystemID) AS CountOfSystemID
SELECT tblPlantInfo.strDivision, tblPlantInfo.strBusinessUnit, tblNonconformanceData.strPlant
FROM tblNonconformanceData LEFT JOIN tblPlantInfo ON tblNonconformanceData.strPlant = tblPlantInfo.strPlant
WHERE (((tblNonconformanceData.strQNType)="Q1") AND ((tblNonconformanceData.SystemReportYear)=[Enter Year]) AND ((tblNonconformanceData.ysnDuplicate)<>True) AND ((tblNonconformanceData.strCategory) Is Not Null))
GROUP BY tblPlantInfo.strDivision, tblPlantInfo.strBusinessUnit, tblNonconformanceData.strPlant, tblNonconformanceData.ysnDuplicate
ORDER BY tblPlantInfo.strDivision, tblPlantInfo.strBusinessUnit
PIVOT tblNonconformanceData.SystemReportMonth;
I have even rewritten the query from scratch as one, in pieces, all to no avail.
The only type of fields retrieved are strings and a boolean. A count of a string field is used for the pivot value.
Anyone with insight into this type of occurrence, I would appreciate your suggestions.
Thanks you.