saraann422
Technical User
I'm having problems with my query. I want to sum each field for clerk. But I either get each clerk once with a sum I don't recognize, each clerk more than once with separeted sums (but they are correct), or an error saying that two of my fields (CC and Cases Promoted to QC) are not part of an aggregate function.
Can anyone help me with this?
Thank you!!
Sarah
SELECT [Clerk - Closed & Promoted to QC].Clerk, ([Clerk - Closed & Promoted to QC]![CC]) AS CC, [Clerk - Closed & Promoted to QC].[Promoted to QC], Sum([Clerk - Closed & Promoted to QC]!EM+[Clerk - Closed & Promoted to QC]!EQ+[Clerk - Closed & Promoted to QC]!RR+[Clerk - Closed & Promoted to QC]!QQ+[Clerk - Closed & Promoted to QC]!T1+[Clerk - Closed & Promoted to QC]!T2+[Clerk - Closed & Promoted to QC]!T3+[Clerk - Closed & Promoted to QC]!T5+[Clerk - Closed & Promoted to QC]!T7+[Clerk - Closed & Promoted to QC]!WR) AS [Priority Mail], Sum([Clerk - Closed & Promoted to QC]!CI+[Clerk - Closed & Promoted to QC]!DD+[Clerk - Closed & Promoted to QC]!FS+[Clerk - Closed & Promoted to QC]!MD+[Clerk - Closed & Promoted to QC]!MM+[Clerk - Closed & Promoted to QC]!PA+[Clerk - Closed & Promoted to QC]!RV+[Clerk - Closed & Promoted to QC]!SS+[Clerk - Closed & Promoted to QC]!TA+[Clerk - Closed & Promoted to QC]!WW) AS [General Mail]
FROM [Clerk - Closed & Promoted to QC], [QC Information]
WHERE ((([Clerk - Closed & Promoted to QC].Date)>=[StartDate] And ([Clerk - Closed & Promoted to QC].Date)<=[EndDate]))
GROUP BY [Clerk - Closed & Promoted to QC].Clerk, ([Clerk - Closed & Promoted to QC]![CC]), [Clerk - Closed & Promoted to QC].[Promoted to QC];
Can anyone help me with this?
Thank you!!
Sarah
SELECT [Clerk - Closed & Promoted to QC].Clerk, ([Clerk - Closed & Promoted to QC]![CC]) AS CC, [Clerk - Closed & Promoted to QC].[Promoted to QC], Sum([Clerk - Closed & Promoted to QC]!EM+[Clerk - Closed & Promoted to QC]!EQ+[Clerk - Closed & Promoted to QC]!RR+[Clerk - Closed & Promoted to QC]!QQ+[Clerk - Closed & Promoted to QC]!T1+[Clerk - Closed & Promoted to QC]!T2+[Clerk - Closed & Promoted to QC]!T3+[Clerk - Closed & Promoted to QC]!T5+[Clerk - Closed & Promoted to QC]!T7+[Clerk - Closed & Promoted to QC]!WR) AS [Priority Mail], Sum([Clerk - Closed & Promoted to QC]!CI+[Clerk - Closed & Promoted to QC]!DD+[Clerk - Closed & Promoted to QC]!FS+[Clerk - Closed & Promoted to QC]!MD+[Clerk - Closed & Promoted to QC]!MM+[Clerk - Closed & Promoted to QC]!PA+[Clerk - Closed & Promoted to QC]!RV+[Clerk - Closed & Promoted to QC]!SS+[Clerk - Closed & Promoted to QC]!TA+[Clerk - Closed & Promoted to QC]!WW) AS [General Mail]
FROM [Clerk - Closed & Promoted to QC], [QC Information]
WHERE ((([Clerk - Closed & Promoted to QC].Date)>=[StartDate] And ([Clerk - Closed & Promoted to QC].Date)<=[EndDate]))
GROUP BY [Clerk - Closed & Promoted to QC].Clerk, ([Clerk - Closed & Promoted to QC]![CC]), [Clerk - Closed & Promoted to QC].[Promoted to QC];