J
jdb
I have a query and need to count the total number of unique records.
For example:
Table: 2004 & 2005 donors
Field1: ID
Field 2: Name
Feild 3: Date
Field 4: Amount
There are multiple entries for each ID. But, I only want to count each ID
once, regardless of how many times it appears.
There is quite a bit on these discussion boards about Count Distinct, and I
think I have the theory right, but am having trouble actually writing the sql
statement - i keep getting an error that says check the syntax.
SELECT Count (ID) FROM (SELECT Distinct ID FROM tbl.2004 & 2005 donors)
Please help with the syntax, and am I correct in placing that statement in
the 'Field' row of a new column in the query design? Do I put anything else
in the 'Table' 'Total', etc rows?
For example:
Table: 2004 & 2005 donors
Field1: ID
Field 2: Name
Feild 3: Date
Field 4: Amount
There are multiple entries for each ID. But, I only want to count each ID
once, regardless of how many times it appears.
There is quite a bit on these discussion boards about Count Distinct, and I
think I have the theory right, but am having trouble actually writing the sql
statement - i keep getting an error that says check the syntax.
SELECT Count (ID) FROM (SELECT Distinct ID FROM tbl.2004 & 2005 donors)
Please help with the syntax, and am I correct in placing that statement in
the 'Field' row of a new column in the query design? Do I put anything else
in the 'Table' 'Total', etc rows?