Results 1 to 4 of 4

Thread: Comparing Queries

  1. #1
    Join Date
    Jul 2003
    Posts
    43

    Comparing Queries

    How can I get Access to compare 3 different queries to create a table with all the duplicates?

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Need more details with example data and query.

  3. #3
    Join Date
    Jul 2003
    Posts
    43

    comparing queries

    Query 2001:

    1
    2
    3
    4
    5

    Query 2002:

    4
    2
    6
    8
    1
    20
    58

    Query 2003

    100
    10090
    578
    1
    2
    348

    This is just to simplify the e.g. But, in actuality I have 100's of student numbers in each query. I need to determine which of the students(i) in Query 1, are found in Query 2 or 3 (ii)Query 2 in Query 3.

    Thank you.

  4. #4
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    (i)

    select distinct * from (
    select Id from query1 where id in (select id from query2)
    union
    select Id from query1 where id in (select id from query3)
    ) as mytable


    (ii)

    select Id from query2 where id in (select id from query3)

Posting Permissions

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