Results 1 to 4 of 4
  1. #1
    geotrouvetout67 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    108

    Select records with last and identical time stamp (not working)

    I'm trying to select records from a table (select query) that have equal time stamps and the latest one in the table and it's not working.

    If I use Last or Max of [Date] by itself, the selection works but as soon as I add the other fields I need then it's showing everything.



    For example if I have 3 rows with a time stamp 08/21/2019 2:07:40 PM and 2 rows with a stamp of 08/21/2019 1:57:44 PM, Last or Max will return 08/21/2019 2:07:40 PM but with other fields I get all 5 rows when I only want the 3 that have the most recent date.

    What would be the work around?

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I take it that you are doing an Aggregate Query and applying the Max field to the Date field.
    Do this in a query, but do NOT add any other fields to this query!

    Then, create a new query in which you join the original table to the query you just created on the Date field.
    You can add any fields that you like. It will then show you all records where the Date matches the latest date.

  3. #3
    geotrouvetout67 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    108
    Quote Originally Posted by JoeM View Post
    I take it that you are doing an Aggregate Query and applying the Max field to the Date field.
    Do this in a query, but do NOT add any other fields to this query!

    Then, create a new query in which you join the original table to the query you just created on the Date field.
    You can add any fields that you like. It will then show you all records where the Date matches the latest date.
    Thanks, that works.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome.

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

Similar Threads

  1. Replies: 10
    Last Post: 02-25-2018, 06:50 PM
  2. Replies: 1
    Last Post: 04-01-2015, 01:29 AM
  3. Date and Time Stamp
    By zoooza84 in forum Access
    Replies: 2
    Last Post: 08-06-2011, 04:53 AM
  4. Time Stamp when field is populated
    By suncluster in forum Access
    Replies: 1
    Last Post: 06-13-2011, 01:39 PM
  5. Append Query: Time Stamp
    By AKQTS in forum Programming
    Replies: 3
    Last Post: 08-16-2010, 12:34 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