Results 1 to 4 of 4
  1. #1
    dr4ke is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    108

    Is Entry In Two Tables?

    Afternoon all - I'm really getting frustrated at how difficult it is to figure this out (!!).



    I have two tables:

    Table1: AllMailboxStats

    Table2: DisconnectedMailboxes

    I want to return 6 columns from Table1 (including 'DisplayName') and 2 columns from Table2 (returning results based on 'DisplayName').

    What I would like is for the Query to search and if Table1.DisplayName=Table2.DisplayName then display 'TRUE' else return 'FALSE'. But every time I get close to this, it only pulls out the entries that are in both Table1 and Table2 (i.e. 472 entries, which all show TRUE as opposed to 5000 entries which have a combination of TRUE & FALSE).

    One of the examples I tried was below, which didn't work - I presume because I Inner Joined them. But If I don't Inner Join it wont see Table2.

    Code:
     SELECTiif([allmailboxstats].[displayname]=[disconnectedmailboxes].[displayname],"Deleted","")
    FROM allmailboxstats
    INNER JOIN disconnectedmailboxes
    ON allmailboxstats.displayname = disconnectedmailboxes.displayname

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Why not run an unmatched query using the query wizard. This will show you all the cases where the displaynames do not match. Your current SQL statement will only give you cases where the displaynames match because you are joining on those fields.

    Alan

  3. #3
    dr4ke is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    108
    Because this will only return those that don't match? I wan't a Query which shows those that do, and those that don't? Not just one or the other.

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Perhaps, if you posted some sample data. (upload a copy of your data base with a sample of the records, not all 5000) we could analyze and determine a proper solution for you. I do believe that you will need to run several queries and ultimately if you want all the data in one query run a union query. I do not believe that you can get this with one query.

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

Similar Threads

  1. Replies: 5
    Last Post: 08-12-2013, 12:53 AM
  2. Replies: 1
    Last Post: 05-17-2012, 05:02 PM
  3. Data Entry into a Form with 3 Tables
    By norcalpsych in forum Forms
    Replies: 14
    Last Post: 04-03-2012, 07:12 PM
  4. Replies: 1
    Last Post: 11-19-2011, 10:36 PM
  5. Entry of Large Data Sets into multiple tables
    By bcouzens in forum Access
    Replies: 8
    Last Post: 05-26-2011, 02:22 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