Nested queries

A

Anna

There is a report which i am trying to debug. This is the main query
which runs in the report:
qry_TopTenErrorReport_Crosstab

If any idea/help whats is going on in the query i would be very
appreciate.

Thanks,

qry_TopTen
----------
SELECT tblCallDetail.ReasonID, Count(tblCallDetail.CallID) AS
CountOfCallID, tblCallDetail.DetailID, tblResults.CallCenterLoc
FROM ((tblResults INNER JOIN tblCallDetail ON tblResults.CallID =
tblCallDetail.CallID) INNER JOIN tblReason ON (tblCallDetail.ReasonID =
tblReason.ReasonID) AND (tblCallDetail.DetailID = tblReason.DetailID))
INNER JOIN qry_TopTenSelect ON (tblCallDetail.ReasonID =
qry_TopTenSelect.ReasonID) AND (tblCallDetail.DetailID =
qry_TopTenSelect.DetailID)
WHERE (((tblCallDetail.DetailResponse)="NO") AND
((tblCallDetail.CategoryID)<3) AND ((tblReason.ReasonDescr) Not Like
"Provide complete / accurate / enough assistance to avoid a repeat
call"))
GROUP BY tblCallDetail.ReasonID, tblCallDetail.DetailID,
tblResults.CallCenterLoc
HAVING (((tblCallDetail.ReasonID)<>0))
ORDER BY Count(tblCallDetail.CallID) DESC;

qry_TopTenErrorReport
---------------------
SELECT [qry_TopTen].CountOfCallID, [tblDetail].[DetailDescr],
[tblReason].[ReasonDescr], [qry_TopTen].CallCenterLoc
FROM (qry_TopTen INNER JOIN tblDetail ON
[qry_TopTen].DetailID=[tblDetail].[DetailID]) INNER JOIN tblReason ON
([qry_TopTen].ReasonID=[tblReason].[ReasonID]) AND
([tblDetail].[DetailID]=[tblReason].[DetailID])
ORDER BY [qry_TopTen].CountOfCallID DESC;

qry_TopTenErrorReport_Crosstab
------------------------------
TRANSFORM Sum(qry_TopTenErrorReport.CountOfCallID) AS
SumOfCountOfCallID
SELECT qry_TopTenErrorReport.ReasonDescr,
Sum(qry_TopTenErrorReport.CountOfCallID) AS CombinedCountOfCallID
FROM qry_TopTenErrorReport
GROUP BY qry_TopTenErrorReport.ReasonDescr
PIVOT qry_TopTenErrorReport.CallCenterLoc;

qryResultsReport
----------------
SELECT tblCallSummary.* INTO tblResults
FROM tblCallSummary
WHERE (((tblCallSummary.[Date/Time]) Between
[forms]![MainMenu]![txtStartDate] And
[forms]![MainMenu]![txtEndDate]+1));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top