Results 1 to 3 of 3
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Select query

    Within a table I have 3 fields:


    ID
    Admin_ID
    Comments

    The ID field is the key, and is an auto number field.
    The Admin_ID field relates to the ID within another table that contains admin information.
    The comments are what are unique.

    Within this table, an Admin_ID can have many records.

    What is the query statement to retrieve the most current record for each Admin_ID?


    Thank you in advance!!

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    I would do it with two queries.

    SELECT Table1.Admin_ID, Max(Table1.ID) AS MaxOfID
    FROM Table1
    GROUP BY Table1.Admin_ID;


    and then

    SELECT Query1.Admin_ID, Query1.MaxOfID, Table1.Comments
    FROM Query1 INNER JOIN Table1 ON Query1.MaxOfID = Table1.ID;

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks. This solves my problem.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-02-2014, 09:29 AM
  2. Replies: 5
    Last Post: 05-01-2013, 11:39 AM
  3. Select Query > Update Query > Table Field
    By tuggleport in forum Queries
    Replies: 2
    Last Post: 08-09-2012, 07:04 AM
  4. Replies: 7
    Last Post: 05-02-2012, 08:04 AM
  5. Replies: 2
    Last Post: 01-31-2011, 08:31 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