Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Posts
    1

    Unanswered: New user needs help with a simple(?) access query

    OK, thanks for reading this, I apologize if I have the wrong group or something.

    Anyway, I am trying to run a simple query that compares 2 tables - BOOKINGS and CONTACTS.

    I would like to do 2 things:

    1) Filter out any records whose CSSID in the CONTACTS table exists in the CONTACTNO in the BOOKINGS table. In other words, if the contact has purchased a service, it will appear in the bookings table. If the contact hasn't, there will be no reference to them. I want to filter in the contacts table people who have any listing in the bookings table.

    2) Seperately, I would like to filter the CONTACTS table by only showing contacts who have a listing in the BOOKINGS table. Then, further filter that by the field COURSENAME ("Level One", "Level Two", etc.)

    Let me know if you need more data.

    Thanks tremendously for your help with this!!

    Ryan

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Hi Ryan, and welcome to the forum....

    Have a look at the method of linking to tables together as part of an SQL statement.
    It can be doen as part of a "where" clause, or preferably as part of a "join" clause.

    eg
    select <table1>.<col1>, <table1>.<col2>, <table1>.<col3>, <table2>.<col1>, <table2>.<col2> from <table1> join <table2> on <table2>.<colx>=<table1>.<coly>

    the access query wizards can go along way down the line to give you a few examples. It can also show you how to find unmatched rows (which is what I think you are looking for.

    Have a look at those and come back if you are struggling
    HTH
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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