Results 1 to 6 of 6
  1. #1
    Jakz34 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2009
    Location
    Jonesboro, AR
    Posts
    4

    Getting Data from 2+ Tables Into 1 Query

    I have 4 tables that I am working with.



    Table 1 is a list of all people in a section who need to register for tickets
    Table 2 is a list of people who have registered for tickets.


    Is there anyway to cross these two tables so that anybody who is listed in table 1 but not 2 is pulled out via query?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    try:
    Code:
    select person from table1 where person 
    
    not in (select person from table2)

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Please note that if the tables have big amount of records, NOT IN condition works very slowly. in this case, JOIN query is recommended.

  4. #4
    Jakz34 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2009
    Location
    Jonesboro, AR
    Posts
    4
    Quote Originally Posted by ajetrumpet View Post
    try:
    Code:
    select person from table1 where person 
    
    not in (select person from table2)


    Where would I put this code?

  5. #5
    Jakz34 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2009
    Location
    Jonesboro, AR
    Posts
    4
    Quote Originally Posted by weekend00 View Post
    Please note that if the tables have big amount of records, NOT IN condition works very slowly. in this case, JOIN query is recommended.
    Yeah, I looked at join query but I wasn't sure which of the three options to choose.

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Jakz34 View Post
    Where would I put this code?
    in the query sql view.

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

Similar Threads

  1. looking up data from different tables
    By deadmanmss in forum Access
    Replies: 8
    Last Post: 08-21-2010, 05:35 PM
  2. Have 3 tables - problem with pulling data for query
    By wulfhund in forum Database Design
    Replies: 2
    Last Post: 08-13-2010, 05:38 AM
  3. Data from three tables
    By dref in forum Forms
    Replies: 3
    Last Post: 07-21-2010, 06:17 AM
  4. Data Sharing within Tables?
    By clai in forum Database Design
    Replies: 1
    Last Post: 11-06-2009, 06:32 PM
  5. Tables and “all data query” ID problem
    By mashe in forum Queries
    Replies: 5
    Last Post: 08-22-2009, 06:05 AM

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