Question : Count Distinct Records - Query

I have the following fields in an Access Database called "Logs":
RecordID, Zip, DonorIDDate

I have this query to count, group, and display Unique records (Between 2 dates):

"SELECT Logs.Zip, Count(Logs.Zip) AS CountOfZip FROM Logs WHERE Logs.DonorIDDate >= #" & dDateFrom & "# AND Logs.DonorIDDate <= #" & dDateTo & "# GROUP BY Logs.Zip"

Now I have one more requirement. If the same Zip is repeated more than once per RecordID, I only want to count it once.

Thanks.

Answer : Count Distinct Records - Query

Try this:
1:
"SELECT Zip, Count(Zip) AS CountOfZip FROM (select distinct Zip, RecordID from Logs WHERE Logs.DonorIDDate >= #" & dDateFrom & "# AND Logs.DonorIDDate <= #" & dDateTo & "#) GROUP BY Zip"
Random Solutions  
 
programming4us programming4us