I'm trying to figure out why this query yields 157 records (the correct number), but when I change the query to a summary query, I get 166. I must be overlooking something, but don't see what it is. I am joining three tables because each of the two main data tables are using a different ID system. The two queries are actually the same query, only difference between the queries below is that I went into design view and clicked on the Summary Button.
Detail Query=157 records (Correct amount)
[tt]
SELECT DISTINCT 3 AS SortOrder, [APP-2004-LST].Fall, "Enrolled" AS Status, [BILL-DEPOSIT-06FY].eg_H, [APP-2004-LST].ETHNIC, [APP-2004-LST].CWID
FROM ([APP-2004-LST] INNER JOIN SSNCWID ON [APP-2004-LST].CWID = SSNCWID.CWID) INNER JOIN [BILL-DEPOSIT-06FY] ON SSNCWID.SSN = [BILL-DEPOSIT-06FY].eg_5854139771
WHERE ((([BILL-DEPOSIT-06FY].eg_H)="LA") AND (([BILL-DEPOSIT-06FY].eg_CC)="CC") AND (([BILL-DEPOSIT-06FY].[eg_*]) Like "*") AND (([BILL-DEPOSIT-06FY].A) In ("D","G")));
[/tt]
Summary Query = 166 (Extra 9)
[tt]
SELECT DISTINCT 3 AS SortOrder, [APP-2004-LST].Fall, "Enrolled" AS Status, [BILL-DEPOSIT-06FY].eg_H, [APP-2004-LST].ETHNIC, Count([APP-2004-LST].CWID) AS CountOfCWID
FROM ([APP-2004-LST] INNER JOIN SSNCWID ON [APP-2004-LST].CWID = SSNCWID.CWID) INNER JOIN [BILL-DEPOSIT-06FY] ON SSNCWID.SSN = [BILL-DEPOSIT-06FY].eg_5854139771
GROUP BY [APP-2004-LST].Fall, [BILL-DEPOSIT-06FY].eg_H, [APP-2004-LST].ETHNIC, [BILL-DEPOSIT-06FY].eg_CC, [BILL-DEPOSIT-06FY].[eg_*], [BILL-DEPOSIT-06FY].A
HAVING ((([BILL-DEPOSIT-06FY].eg_H)="LA") AND (([BILL-DEPOSIT-06FY].eg_CC)="CC") AND (([BILL-DEPOSIT-06FY].[eg_*]) Like "*") AND (([BILL-DEPOSIT-06FY].A) In ("D","G")));
[/tt]
Detail Query=157 records (Correct amount)
[tt]
SELECT DISTINCT 3 AS SortOrder, [APP-2004-LST].Fall, "Enrolled" AS Status, [BILL-DEPOSIT-06FY].eg_H, [APP-2004-LST].ETHNIC, [APP-2004-LST].CWID
FROM ([APP-2004-LST] INNER JOIN SSNCWID ON [APP-2004-LST].CWID = SSNCWID.CWID) INNER JOIN [BILL-DEPOSIT-06FY] ON SSNCWID.SSN = [BILL-DEPOSIT-06FY].eg_5854139771
WHERE ((([BILL-DEPOSIT-06FY].eg_H)="LA") AND (([BILL-DEPOSIT-06FY].eg_CC)="CC") AND (([BILL-DEPOSIT-06FY].[eg_*]) Like "*") AND (([BILL-DEPOSIT-06FY].A) In ("D","G")));
[/tt]
Summary Query = 166 (Extra 9)
[tt]
SELECT DISTINCT 3 AS SortOrder, [APP-2004-LST].Fall, "Enrolled" AS Status, [BILL-DEPOSIT-06FY].eg_H, [APP-2004-LST].ETHNIC, Count([APP-2004-LST].CWID) AS CountOfCWID
FROM ([APP-2004-LST] INNER JOIN SSNCWID ON [APP-2004-LST].CWID = SSNCWID.CWID) INNER JOIN [BILL-DEPOSIT-06FY] ON SSNCWID.SSN = [BILL-DEPOSIT-06FY].eg_5854139771
GROUP BY [APP-2004-LST].Fall, [BILL-DEPOSIT-06FY].eg_H, [APP-2004-LST].ETHNIC, [BILL-DEPOSIT-06FY].eg_CC, [BILL-DEPOSIT-06FY].[eg_*], [BILL-DEPOSIT-06FY].A
HAVING ((([BILL-DEPOSIT-06FY].eg_H)="LA") AND (([BILL-DEPOSIT-06FY].eg_CC)="CC") AND (([BILL-DEPOSIT-06FY].[eg_*]) Like "*") AND (([BILL-DEPOSIT-06FY].A) In ("D","G")));
[/tt]