Results 1 to 3 of 3
  1. #1
    jcharbula is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    5

    Help with "Group By" using SQL in Access


    I am using the group by function to remove duplicates based on certain fields. However, I want the Primary Key ID to also be returned
    If I add it to the select statement, I have to also add it to the Group By line which messes up the duplicates
    So...how can I just view the ID field in my return without making it part of the group by function?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Please post the SQL of the query you are using.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Sounds like a Normalization issue. If the data is in a Normalized table structure, you should be able to use the GROUP BY clause successfully.

    Can you give a brief description, from a business rules perspective, of what you are trying to group. What are these groups going to associate with?

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

Similar Threads

  1. Replies: 15
    Last Post: 08-20-2013, 07:50 AM
  2. Replies: 12
    Last Post: 05-23-2013, 10:56 AM
  3. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  4. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM

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