Results 1 to 3 of 3
  1. #1
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110

    Query Multiple Lasts

    Hello Query Experts

    I have a database which is becoming quite a piece of work, but there is something that I'm really struggling with.

    I can create queries and I'm becoming quite good at getting the data I want displayed is for example, I want to show all companies that have a Director in related tables, however I have a bigger step I need to take and I'm getting close to having to develop this part of the database.

    So I have a company table:
    DueDiligence
    DDKey - Primary Key

    It then has a one to many with

    tblKYC
    KYCSegmentKey - Primary Key
    DDKey as the Foreign Key

    This then has a one to many relationship with the following tables all have the foreign key DDKey
    tblKYCReview
    tblKYCBackground
    tblKYCMeeting
    tblKYCTransport


    tblKYCTerms
    tblKYCDeal

    As a user updating a form each Company will have many deals or have many meetings.

    However the Director wants to only be able to see the very last meeting, and very last deal and very last review in his report.

    How do I filter a query to return so many Last records all in one query?

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi Steven

    Your Main Report would be based on your tblDueDiligence and tblKYC

    Then for each of the required tables
    tblKYCReview, tblKYCMeeting & tblKYCDeal

    Each of these tables would be placed into SubReport's
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You can use subqueries or create separate totals queries for each of the 6 tables where you Group By DirectorID and select Max for either the date stamp or the autonumber ID PK (assuming it is set ascending not random).
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 6
    Last Post: 09-05-2019, 09:14 AM
  2. Replies: 2
    Last Post: 05-21-2017, 05:40 PM
  3. Replies: 1
    Last Post: 05-01-2017, 12:11 PM
  4. Replies: 1
    Last Post: 04-12-2013, 03:03 PM
  5. Replies: 7
    Last Post: 01-02-2013, 11:23 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