Results 1 to 4 of 4
  1. #1
    Softweb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    2

    How do I the last record in a table


    I have an Access database that has a Client table and an Appointment table. Clients can has one or more appointments. I need to produce a Query that pulls out the latest record for each Client. Any help on how to do this would be really appreciated.I have an Access database that has a Client Table and an Appointment table. Clients can has one or more appointments. I need to produce a Query that pulls out the latest record for each Client. Any help on how to do this would be really appreciated.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Take look at using an Aggregate (Totals) Query.

    You will "group" on the Client ID, and return the "max" value for your appointment date.
    If you want to get the other details from that record, link this Aggregate Query back in with your data tables, joining on the Client ID and appointment date fields.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,627
    Another approach is TOP n, review http://allenbrowne.com/subquery-01.html#TopN
    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.

  4. #4
    Softweb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    2
    Many thanks

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

Similar Threads

  1. Replies: 4
    Last Post: 02-18-2015, 11:28 AM
  2. Replies: 4
    Last Post: 01-20-2015, 12:55 PM
  3. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  4. Replies: 3
    Last Post: 02-06-2013, 07:23 PM
  5. Replies: 3
    Last Post: 08-09-2012, 01:49 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