Results 1 to 6 of 6
  1. #1
    caddcop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Upper Marlboro, Maryland, USA
    Posts
    57

    Returning inverse of a query

    I am working with an Access data base started by others that is actually part of a commercial product. The commercial product's license model is node locked. So I have been asked to develop some forms within the Access database which would allow minor updates and edits to the database, outside of the commercial program.
    I can add tables, queries, forms, reports, etc. On a few tables, I am even allowed to add columns. However, as it is setup, there are certain tables that contain an ID field which is used as a join on queries.


    As it turns out, unless a user enter certain data via the application, the second table does not get a matching record. Since one of my tasks it to develop a dialog box that can be used to add to these records, I need to query the database to return those records in Table One which do not have a corresponding record in Table Two.
    Can someone suggest a method to accomplish this?

  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,521
    Have you tried the unmatched query wizard?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    caddcop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Upper Marlboro, Maryland, USA
    Posts
    57
    I figured out that a left join would do some of what I wanted but I will looked at the unmatched query wizard. Thanx.

  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,521
    The wizard will create a query with a left join, so you're on the right track.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    caddcop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Upper Marlboro, Maryland, USA
    Posts
    57
    I'm going to mark this solved, but my PC does not have all of the wizards installed, so I have to dust off my SQL hat to develop certain queries.
    I found when I first started with Access, that certain results difficult to create in the design view but with the SQL mode I could adjust things pretty quickly. And if I wanted to, I could switch back to design mode to see how it could be done there.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Post back if you get stuck. Like I said, the wizard will create a left join, with a criteria of

    Is Null

    on the joined field from the "right" table (table 2 in your example). That will return those records in table 1 with no corresponding record in table 2.
    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: 2
    Last Post: 03-23-2011, 11:13 AM
  2. Union query only returning 255 characters
    By jpkeller55 in forum Queries
    Replies: 25
    Last Post: 10-05-2010, 05:51 AM
  3. Query Bug? Not returning consistent results
    By trb5016 in forum Queries
    Replies: 4
    Last Post: 06-15-2010, 12:00 PM
  4. Query not returning all of the results
    By velvettiger in forum Queries
    Replies: 4
    Last Post: 03-11-2010, 06:56 AM
  5. Returning correct rows in a join/nested query
    By goneaccessing in forum Queries
    Replies: 5
    Last Post: 03-03-2010, 12:21 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