Results 1 to 3 of 3

Thread: Help with query

  1. #1
    Join Date
    Apr 2009
    Posts
    16

    Unanswered: Help with query

    Hello all

    It has been some time since I have done some sql programming (other than simple select queries) and therfore require some help in writing an sql query. I have tried to simplify it as much as possible with the following example of what I am trying to achieve.

    We have two tables, tbl1 and tbl2. Tbl1 contains a list of people and the items they own. Tbl2 contains a list of these items and the groups they belong too. I want to write an sql query that will select all the missing items the person in tbl1 requires in order to have a complete group. If they dont have an item from a group then I dont want that group to appear for that person.

    So lets say in monopoly terms, a person owns property on a green street and a brown street, but no property on the yellow street, i want to find the properties he doesnt own on the green and brown street.

    Hope the above is clear....

    Any guidance or tips on how to do the above would be great!

    Thanks in advance!

    t.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    well might be best to show your tables

    there is a wizard in Accessd that will find this for you
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2009
    Posts
    16
    Hi healdem and thanks for your response!

    I have resolved this now. I just created two seperate queries 1) all possible items a person could own 2) all the items they do own. I then joined the two queries based on personid and group fields of the queries and then filtered the tables where the items in the two tables did not match.

    Works....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •