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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Total query summing AND multiplying

Status
Not open for further replies.

mongous

Technical User
Jun 18, 2002
116
US
I acidentally posted this in the 'forms' section originally...

I am trying to create a simple Total query, but it is not only totaling but multiplying by each instance. EX:

I have a tblSites with 4 entries:[red]
BHM
CWA
SEA
SPK
[/red]
Some sites contains multiple lines of input. (it's a call center and some sites have more than one phone line(called split). So you end up with the data for EACH line totaled, and I need to total THOSE into one output.
So my query totals all the calls, but then it multiplies that by each instance of the siteID. For instance for SPK there are two splits, so it totals all calls then multiplies by each instance of SPK (2).

Here is the SQL so far:

[blue]
SELECT qryCSCTotals.SiteID, Sum(qryCSCTotals.[Total AcdCalls]) AS TtlCallsAnswered
FROM qryCSCTotals INNER JOIN tblSites ON qryCSCTotals.SiteID = tblSites.SiteID
GROUP BY qryCSCTotals.SiteID;
[/blue]

Can anyone offer any help? Thanks.
 
Never mind. I figured it out. Not too hard...

Turns out I didn't need the INNER Join.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top