Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing in a Query

Status
Not open for further replies.

saraann422

Technical User
Apr 17, 2008
21
0
0
US
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];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top