Results 1 to 4 of 4
  1. #1
    mari_hitz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    28

    Lines duplicated with Queries

    Hi!
    I have a database with two tables and I have performed a query that returns me the values of table one that are not included in table two. The data is from several people and they only appear once in table one and also in table two, however the query returns me several lines for each individual. Do you have any idea why this is happening?

    Thanks!

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Suggest you post your SQL statement. Difficult to diagnose without that information.

  3. #3
    mari_hitz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    28
    Thanks! Here it is what appears on SQL:
    Code:
    SELECT SRR.conca, SRR.[Personnel Number], SRR.[First Name], SRR.[Last Name], SRR.[Home Country], SRR.[Host Country], SRR.[Assignment Start Date], SRR.[Assignment End Date], SRR.[TOTAL DAYS], SRR.[GENERAL CONTROL], SRR.[DAYS OUT OF ASSIGNMENT], Immigration.[Expired with NO action ]
    FROM SRR INNER JOIN Immigration ON SRR.conca=Immigration.conca;
    Am I missing something?

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Try changing the Join from INNER to LEFT

    Code:
    SELECT SRR.conca, SRR.[Personnel Number], SRR.[First Name], SRR.[Last Name], SRR.[Home Country], SRR.[Host Country], SRR.[Assignment Start Date], SRR.[Assignment End Date], SRR.[TOTAL DAYS], SRR.[GENERAL CONTROL], SRR.[DAYS OUT OF ASSIGNMENT], Immigration.[Expired with NO action ]
    FROM SRR LEFT JOIN Immigration ON SRR.conca=Immigration.conca;
    This will give you every record from the SRR table and only those records from the Immigration table where there is a conca record.

    Alan

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

Similar Threads

  1. How To Hide Duplicated Entire Row In Reports
    By vdanelia in forum Reports
    Replies: 1
    Last Post: 09-29-2011, 08:10 AM
  2. Querying id by having criteria in two lines
    By ahunter488 in forum Queries
    Replies: 3
    Last Post: 06-21-2011, 05:21 PM
  3. Records duplicated based on field
    By dskulman in forum Queries
    Replies: 3
    Last Post: 03-03-2011, 06:26 PM
  4. Creating Multiple Lines per Member
    By SecretGeek in forum Access
    Replies: 2
    Last Post: 08-20-2010, 06:19 AM
  5. Replies: 2
    Last Post: 07-15-2010, 10:26 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