B
Bob Barnes
I haven't written a Subquery yet...and need..
...the Top 5 "NumTotal" (DESC) by MktMgr..from this...
SELECT GoMarkets.MktMgr, Count(AllSummary.ANSWER) AS NumTotal,
AllSummary.QUESTION AS QuesNum, IIf(ANSWER=2,"No","") AS Ans,
AllSummary.AREAMGR, AllSummary.RegMkt, Questions.TheQuestion
FROM GoMarkets INNER JOIN (AllSummary LEFT JOIN Questions ON
AllSummary.QUESTION = Questions.QuestionNum) ON GoMarkets.TheMkt =
AllSummary.RegMkt
WHERE (((AllSummary.ANSWER)=2 Or (AllSummary.ANSWER)=3) AND
((AllSummary.LASTINSP) Between [Forms]![frmMain]![BegFin] And
[Forms]![frmMain]![EndFin]))
GROUP BY GoMarkets.MktMgr, AllSummary.QUESTION, AllSummary.AREAMGR,
AllSummary.RegMkt, Questions.TheQuestion
HAVING ((Not (AllSummary.RegMkt) Is Null))
ORDER BY Count(AllSummary.ANSWER) DESC , AllSummary.QUESTION;
TIA - Bob
...the Top 5 "NumTotal" (DESC) by MktMgr..from this...
SELECT GoMarkets.MktMgr, Count(AllSummary.ANSWER) AS NumTotal,
AllSummary.QUESTION AS QuesNum, IIf(ANSWER=2,"No","") AS Ans,
AllSummary.AREAMGR, AllSummary.RegMkt, Questions.TheQuestion
FROM GoMarkets INNER JOIN (AllSummary LEFT JOIN Questions ON
AllSummary.QUESTION = Questions.QuestionNum) ON GoMarkets.TheMkt =
AllSummary.RegMkt
WHERE (((AllSummary.ANSWER)=2 Or (AllSummary.ANSWER)=3) AND
((AllSummary.LASTINSP) Between [Forms]![frmMain]![BegFin] And
[Forms]![frmMain]![EndFin]))
GROUP BY GoMarkets.MktMgr, AllSummary.QUESTION, AllSummary.AREAMGR,
AllSummary.RegMkt, Questions.TheQuestion
HAVING ((Not (AllSummary.RegMkt) Is Null))
ORDER BY Count(AllSummary.ANSWER) DESC , AllSummary.QUESTION;
TIA - Bob