Results 1 to 7 of 7
  1. #1
    spercoco is offline Novice
    Windows 10 Office 365
    Join Date
    Apr 2022
    Location
    Linden, NJ
    Posts
    3

    Challenging Query


    I am a newbie to the forum. I write research reports on publicly-traded companies. In this case, I have two Access databases (i.e. tables) - one for tracking people that also keeps tabs on the companies that they are interested in - e.g. MSFT (the "Contacts" database) and another providing a list of people who have received specific reports that I have written (the "Communications" database). Each record in Communications lists the report number, person receiving the report (and also the date). I want to create a query of all people who are interested in MSFT and also list whether or not they have received my latest MSFT report. (This would allow me to see at a glance those MSFT investors who have not received the report.) Without going into all the details, I am having trouble creating this query. Can anyone help me with this? Also, whether or not you can help, can you provide a reference source (online or perhaps a book or course) that would help me learn how to create complex queries? Thank you for any help that you can provide.

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    You may want to read about Left Joins, in your case you want to join the contacts table to the communications table on PersonID with the arrow pointing towards the latest.
    https://www.w3schools.com/sql/sql_join_left.asp

    https://www.sqlservertutorial.net/sq...ver-left-join/

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    then you need a field , maybe a date fld: RptRcvd on the tContacts tbl to put the date they got the report.

    join tContact ->tContactStocks and update: RptRcvd = Date()

  4. #4
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Another link that may be useful: Query Join Types (isladogs.co.uk)
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  5. #5
    spercoco is offline Novice
    Windows 10 Office 365
    Join Date
    Apr 2022
    Location
    Linden, NJ
    Posts
    3
    Thanks, Gicu. I was not able to get it to work on a quick retry using your suggestions, but I'll work on it more carefully and let you know how I make out.

  6. #6
    spercoco is offline Novice
    Windows 10 Office 365
    Join Date
    Apr 2022
    Location
    Linden, NJ
    Posts
    3
    Thanks, ranman. I'll post again when I get it to work.

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    It would help to show a screen shot of your attempt.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Challenging query with execptions/conditions
    By skydivetom in forum Queries
    Replies: 3
    Last Post: 06-06-2021, 12:03 AM
  2. Replies: 0
    Last Post: 06-17-2016, 05:32 PM
  3. Back with a more challenging query
    By satswid in forum Access
    Replies: 0
    Last Post: 12-05-2011, 03:53 AM
  4. Replies: 2
    Last Post: 12-05-2011, 03:44 AM
  5. Challenging design
    By Zoroxeus in forum Database Design
    Replies: 0
    Last Post: 01-30-2006, 11:27 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