Results 1 to 4 of 4
  1. #1
    wetsnow13 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    11

    Return one record per project by max date

    Hi,

    I have three tables:
    tblProj, tblProjNotes, tblProjNotesType

    tblProjNotes has 2 foreign keys (and a PK) - to tblProj and to tblProjNotesType

    Each project has multiple notes and each note has a type designation and a date.

    I would like to query the newest dated note for each project and return the note type.



    For responders: Classify me as newbie - I rely on the QBE, but am getting better at turning it over to the SQL

    Thanks in advance!
    W

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,531
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    wetsnow13 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    11
    Hi pbaldy,

    I actually just found that link in another forum - after searching for answers for 2 days - used it and it worked beautifully!

    Perhaps I need to refine my Googling as well

    this is what I did - basically an exact copy of your link:

    SELECT qrySubAll.*
    FROM qrySubAllMax INNER JOIN qrySubAll ON (qrySubAllMax.ProjProjectID = qrySubAll.ProjProjectID) AND (qrySubAllMax.MaxNoteDate = qrySubAll.ProjNotesDate);

    the qrySubAll whittled down the notes table to submittal types of notes and the qrySubAllMax took that and got the max date for each project. Thank you for showing me how to link these queries to return all the columns I need!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,531
    Happy to help!
    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: 21
    Last Post: 04-29-2015, 11:57 PM
  2. Replies: 3
    Last Post: 04-01-2012, 01:40 PM
  3. Return DLookup result as date?
    By kman42 in forum Access
    Replies: 8
    Last Post: 04-22-2011, 11:35 AM
  4. Query return for date ranges.
    By Desstro in forum Queries
    Replies: 2
    Last Post: 09-14-2010, 06:44 AM
  5. return last updated date for each product
    By jonnyuk3 in forum Queries
    Replies: 0
    Last Post: 06-17-2009, 04:38 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