Results 1 to 3 of 3
  1. #1
    dwe73 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    5

    query with onefield Unique value and last date/time

    I need to build a Status Query from my DB that shows the record for each unique value in Field 1 with the most recent date/time entry? Say my DB looks like....

    Record ID AutoNumber
    Field 1 Combo Box Text (4 choices)
    Day Short date
    Time Short Time
    Field 2 Text
    Field 3 Short Time
    Field 4 Text

    These entries may be several times a day for each of the 4 choices! I need the Query to return the last sequential Entry for each of the 4 choices of Field 1.

    Thanks in advance for all of your responses!

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 10 Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Try this:

    SELECT Table1.Field1, Max(Table1.Day) AS MaxOfDay, Max(Table1.Time) AS MaxOfTime, Table1.Field2, Table1.Field4
    FROM Table1
    GROUP BY Table1.Field1, Table1.Field2, Table1.Field4;

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Or this if I understand correctly:

    http://www.baldyweb.com/LastValue.htm
    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. Replies: 4
    Last Post: 12-29-2015, 03:25 PM
  2. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  3. Subtracting a date/time field from a number to get date/time
    By Lifeseeker1019 in forum Programming
    Replies: 4
    Last Post: 03-28-2014, 12:59 PM
  4. Replies: 1
    Last Post: 03-13-2014, 07:23 PM
  5. Replies: 3
    Last Post: 03-11-2014, 07:32 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