How do I create a query containing records from a table, excluding any duplicate records within that table?
How do I create a query containing records from a table, excluding any duplicate records within that table?
Which record do you want - the most recent?
Or do you want just one field and not show duplicate values?
SELECT DISTINCT [fieldname] FROM tablename;
Or do you want to summarize data?
SELECT Account, Sum(Amount) As SumAmt FROM tablename GROUP BY Account;
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks for replying.
I'd like for any of the duplicates to not appear in the query.
Example Table data:
ID Number:
53
56
53
56
59
30
Query results:
ID Number:
59
30
You want only where the count = 1.
Try
SELECT ID FROM tablename GROUP BY ID HAVING Count(ID)=1;
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank you. Exactly what I need!!