Results 1 to 4 of 4
  1. #1
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82

    Query to return unique or distinct rows based on 2 fields (columns)

    I have a table with perhaps 10 columns or so. I'd like to return all of the columns but only some of the rows. The rows I would like to select are unique or distinct rows just looking at two of the columns. Can an Access query do this or do I need to develop something in VBA?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What value do you want for the other fields? Create a new query and add all 10 columns. Click on the Totals icon on the ribbon. Leave Group By on the 2 fields and change it to Min, Max, Sum or whatever for the others.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    Group By did the trick. Thanks.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Report with Unique Fields as Columns
    By carcement in forum Access
    Replies: 1
    Last Post: 04-24-2014, 02:55 PM
  2. Replies: 1
    Last Post: 07-30-2013, 06:33 AM
  3. Replies: 1
    Last Post: 10-29-2012, 08:15 AM
  4. Query to find and COMBINE rows based on 2 fields
    By admessing in forum Queries
    Replies: 2
    Last Post: 12-13-2011, 12:59 PM
  5. Replies: 6
    Last Post: 07-21-2011, 04:51 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