D
Deb
I built a crosstab query, and want to build another query which pulls the
crosstab information plus Unit Cost from another query. Code is as follows:
SELECT ctqry_MthDrmPriority.Division, ctqry_MthDrmPriority.Program,
ctqry_MthDrmPriority.[1], ctqry_MthDrmPriority.[2], ctqry_MthDrmPriority.[3],
ctqry_MthDrmPriority.CASREP, ctqry_MthDrmPriority.DTO,
FROM (SELECT sqry_MonthlyRpt.UnitCost FROM sqry_MonthlyRpt WHERE Division =
sqry_MonthlyRpt.Division) AS [Sum of Unit Costs] ctqry_MthDrmPriority,
GROUP BY ctqry_MthDrmPriority.Division, ctqry_MthDrmPriority.Program,
ctqry_MthDrmPriority.[1], ctqry_MthDrmPriority.[2], ctqry_MthDrmPriority.[3],
ctqry_MthDrmPriority.CASREP, ctqry_MthDrmPriority.DTO
HAVING (((ctqry_MthDrmPriority.[1]) Is Not Null)) OR
(((ctqry_MthDrmPriority.[2]) Is Not Null)) OR (((ctqry_MthDrmPriority.[3]) Is
Not Null)) OR (((ctqry_MthDrmPriority.CASREP) Is Not Null)) OR
(((ctqry_MthDrmPriority.DTO) Is Not Null))
ORDER BY ctqry_MthDrmPriority.Division, ctqry_MthDrmPriority.Program;
I think using a subquery is the way to go, and I've tried several different
angles. The latest error message is:
"The SELECT statement includes a reserved word or an argument name that is
misspelled or missing, or the punctuation is incorrect."
I've checked for misspellings, and am just unsure if the punctuation is
incorrect or if something is missing. Of course, the subquery might even be
in the wrong place, I just don't know.
Please advise.
crosstab information plus Unit Cost from another query. Code is as follows:
SELECT ctqry_MthDrmPriority.Division, ctqry_MthDrmPriority.Program,
ctqry_MthDrmPriority.[1], ctqry_MthDrmPriority.[2], ctqry_MthDrmPriority.[3],
ctqry_MthDrmPriority.CASREP, ctqry_MthDrmPriority.DTO,
FROM (SELECT sqry_MonthlyRpt.UnitCost FROM sqry_MonthlyRpt WHERE Division =
sqry_MonthlyRpt.Division) AS [Sum of Unit Costs] ctqry_MthDrmPriority,
GROUP BY ctqry_MthDrmPriority.Division, ctqry_MthDrmPriority.Program,
ctqry_MthDrmPriority.[1], ctqry_MthDrmPriority.[2], ctqry_MthDrmPriority.[3],
ctqry_MthDrmPriority.CASREP, ctqry_MthDrmPriority.DTO
HAVING (((ctqry_MthDrmPriority.[1]) Is Not Null)) OR
(((ctqry_MthDrmPriority.[2]) Is Not Null)) OR (((ctqry_MthDrmPriority.[3]) Is
Not Null)) OR (((ctqry_MthDrmPriority.CASREP) Is Not Null)) OR
(((ctqry_MthDrmPriority.DTO) Is Not Null))
ORDER BY ctqry_MthDrmPriority.Division, ctqry_MthDrmPriority.Program;
I think using a subquery is the way to go, and I've tried several different
angles. The latest error message is:
"The SELECT statement includes a reserved word or an argument name that is
misspelled or missing, or the punctuation is incorrect."
I've checked for misspellings, and am just unsure if the punctuation is
incorrect or if something is missing. Of course, the subquery might even be
in the wrong place, I just don't know.
Please advise.