Results 1 to 2 of 2
  1. #1
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183

    Unique distinct records for multiple columns

    What is the best way to calculate unique distinct records for multiple columns in Access queries.



    I tried :

    Code:
    SELECT DISTINCT Column_NameA FROM Table_Name;
    That works perfectly fine. But what if I have multiple columns that I would like to see but the distinct should be based on Column_NameA

    Any suggestions?

    Thanks in advance

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    One way is to use Aggregate Queries, in which you "Group" all like records together (to weed out duplicates) based on any number of fields you want.

    That might look something like this (which "Groups By" three fields):
    Code:
    SELECT Field1, Field2, Field3
    FROM Table_Name
    GROUP BY Field1, Field2, Field3;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-06-2014, 01:25 PM
  2. Replies: 3
    Last Post: 05-29-2014, 09:50 AM
  3. Replies: 1
    Last Post: 04-30-2014, 01:05 AM
  4. Replies: 1
    Last Post: 03-28-2013, 11:10 PM
  5. Replies: 2
    Last Post: 02-04-2011, 08:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums