kentwoodjean
Technical User
I have been trying different things for about 2 hours off and on and need some advise/assistance. I have 2 queries that I am attempting to join. WritClosed (made from 3 queries) and Tele(made from 1 query). Each by themselves works perfectly and gives me the correct information by date. Together, it causes my counts from the Tele Q to double. Tried different join options, but no luck. Here is the SQL on my attempt to joint these 2 queries:
SELECT [POS DailyTot].ToDate, [SumOfAns]/[SumOfTotHandled] AS AvTSF, Sum([POS DailyTot].TotOffer) AS SumOfTotOffer, Sum([POS DailyTot].TotHandled) AS SumOfTotHandled, Sum([POS DailyTot].TotAband) AS SumOfTotAband, [SumofTotAband]/[SumOfTotOffer] AS PercentOfCanc, Sum([POS DailyTot].As) AS SumOfAs, [SumOfAs]/[SumOfTotHandled] AS AvgASA, Sum([POS DailyTot].Ans) AS SumOfAns, Avg([POS DailyTot].ATT) AS AvgOfATT, [SumOfAw]/[SumOfTotOffer] AS AvgWrap, Sum([POS DailyTot].Aw) AS SumOfAw, ReceivedAndClosedCountsbyDate.[Recd Dt], ReceivedAndClosedCountsbyDate.[CountOfRecd Dt], ReceivedAndClosedCountsbyDate.[CountOfClosed Dt], ReceivedAndClosedCountsbyDate.EndInv
FROM [POS DailyTot] LEFT JOIN ReceivedAndClosedCountsbyDate ON [POS DailyTot].ToDate = ReceivedAndClosedCountsbyDate.[Recd Dt]
GROUP BY [POS DailyTot].ToDate, ReceivedAndClosedCountsbyDate.[Recd Dt], ReceivedAndClosedCountsbyDate.[CountOfRecd Dt], ReceivedAndClosedCountsbyDate.[CountOfClosed Dt], ReceivedAndClosedCountsbyDate.EndInv
HAVING ((([POS DailyTot].ToDate) Between #1/1/2004# And #12/31/2004#) AND ((ReceivedAndClosedCountsbyDate.[Recd Dt])=[ToDate]));
I previously learned from this forum what a Union Query was and how to do one. I have done 2 since then and through trial and error got them working. Do I need a union query here, and if so, can someone assist me please. What I have here is a bit more complicated than the other ones I did.
SELECT [POS DailyTot].ToDate, [SumOfAns]/[SumOfTotHandled] AS AvTSF, Sum([POS DailyTot].TotOffer) AS SumOfTotOffer, Sum([POS DailyTot].TotHandled) AS SumOfTotHandled, Sum([POS DailyTot].TotAband) AS SumOfTotAband, [SumofTotAband]/[SumOfTotOffer] AS PercentOfCanc, Sum([POS DailyTot].As) AS SumOfAs, [SumOfAs]/[SumOfTotHandled] AS AvgASA, Sum([POS DailyTot].Ans) AS SumOfAns, Avg([POS DailyTot].ATT) AS AvgOfATT, [SumOfAw]/[SumOfTotOffer] AS AvgWrap, Sum([POS DailyTot].Aw) AS SumOfAw, ReceivedAndClosedCountsbyDate.[Recd Dt], ReceivedAndClosedCountsbyDate.[CountOfRecd Dt], ReceivedAndClosedCountsbyDate.[CountOfClosed Dt], ReceivedAndClosedCountsbyDate.EndInv
FROM [POS DailyTot] LEFT JOIN ReceivedAndClosedCountsbyDate ON [POS DailyTot].ToDate = ReceivedAndClosedCountsbyDate.[Recd Dt]
GROUP BY [POS DailyTot].ToDate, ReceivedAndClosedCountsbyDate.[Recd Dt], ReceivedAndClosedCountsbyDate.[CountOfRecd Dt], ReceivedAndClosedCountsbyDate.[CountOfClosed Dt], ReceivedAndClosedCountsbyDate.EndInv
HAVING ((([POS DailyTot].ToDate) Between #1/1/2004# And #12/31/2004#) AND ((ReceivedAndClosedCountsbyDate.[Recd Dt])=[ToDate]));
I previously learned from this forum what a Union Query was and how to do one. I have done 2 since then and through trial and error got them working. Do I need a union query here, and if so, can someone assist me please. What I have here is a bit more complicated than the other ones I did.