Results 1 to 3 of 3
  1. #1
    karambos is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2013
    Posts
    4

    joining in MS Access

    I'm new to MS Access. I have a very simple database in Access. It consists of 3 tables. Each table has only 1 column, "Serial numbers". This is a fixed width column consisting of 7 numbers with data type "number".

    Within each table, each number appears only once. However, some numbers will appear in all three tables, some in only 2 tables and others will be only in 1 table.

    I need to find:
    • those serial numbers that exist in all 3 tables
    • those serials that exist in tables 1&2 but not 3
    • those serials that exist in table 1 only; not in tables 2 & 3


    I'd be grateful if someone could give me a high level overview of how to do this in Access.


    Thanks in advance
    ~K

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Using unmatched queries wizard for #2 & #3....

    Maybe something like this??

    Queries
    1)
    those serial numbers that exist in all 3 tables
    qryMatchInAll3

    Add the 3 tables to the query and link on the serial number field


    2)
    those serials that exist in tables 1&2 but not 3
    qryIn1and2 Without Matching Table3

    create a query as in #1, but with tables 1 & 2, then use the unmatched query wizard to add qryIn1and2 and table 3



    3)
    those serials that exist in table 1 only; not in tables 2 & 3
    Table1 Without Matching qryIn2And3

    create a query as in #1, but with tables 2 & 3, then use the unmatched query wizard to add table 1 and query qryIn2And3


    See attached mdb

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    First thing you might want to do is create a 'master' dataset of all possible serial numbers. A UNION query can accomplish:

    SELECT SerialNumber FROM table1
    UNION SELECT SerialNumber FROM table2
    UNION SELECT SerialNumber FROM table3;

    Now use that query as source for subsequent queries.

    Build a query that joins each of the original 3 tables to the UNION query. Use join type 'Include all records from Query1 ...'.

    Where fields from the original 3 tables are blank, the SerialNumber is not in that table.

    Can apply filters and sorts to the second query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. DB templates Joining
    By engr in forum Access
    Replies: 1
    Last Post: 11-04-2013, 08:50 AM
  2. joining tables
    By frozendmj in forum Queries
    Replies: 5
    Last Post: 04-19-2011, 01:45 PM
  3. Joining more than 2 tables
    By anemoskkk in forum Access
    Replies: 6
    Last Post: 04-17-2011, 04:37 AM
  4. Help - Joining Tables..
    By fabian24 in forum Forms
    Replies: 3
    Last Post: 02-17-2011, 03:43 PM
  5. joining on two userid's
    By svcghost in forum Queries
    Replies: 9
    Last Post: 09-30-2010, 06:48 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