Results 1 to 2 of 2
  1. #1
    poporacer is offline Novice
    Windows Vista Access 2003
    Join Date
    Oct 2008
    Posts
    2

    Question Query in Query

    I have two tables (tblRoster and tblAKA) tblRoster has the specifics on each person (ID#(unique identifier) Name, Address, Phone) tblAKA has the ID# and nicknames, sometimes more than one nickname for a person. I need a query that will join the two tables BUT I only want one entry for each person.

    Here is an example of what I am trying to do:

    tblRoster:
    ID Name Address Phone
    1 Betty 123 St. 555-123-1234
    2 Sam 321 W. 555-987-1234
    3 Tom 456 S. 555-456-9876

    tblAKA:
    ID Nick
    1 Betty Boop
    2 Shorty
    1 Scary

    And I want to get the following results:
    ID Name Address Phone Nick
    1 Betty 123 St. 555-123-1234 Betty Boop
    2 Sam 321 W. 555-987-1234 Shorty
    3 Tom 456 S. 555-456-9876

    I tried a Left Join and tried to use the DISTINCT property on the ID but still got duplicates:

    ID Name Address Phone Nick
    1 Betty 123 St. 555-123-1234 Betty Boop
    1 Betty 123 St. 555-123-1234 Scary
    2 Sam 321 W. 555-987-1234 Shorty
    3 Tom 456 S. 555-456-9876

    I also tried something but didn't work but seemed close:


    SELECT ID, Name, Address, Phone, tblAKA.Nick
    FROM tblRoster
    LEFT JOIN
    (SELECT DISTINCT tblAKA.ID, tblAKA.Nick FROM tblAKA) on tblRoster.ID = tblAKA.ID

    Any Ideas???

  2. #2
    poporacer is offline Novice
    Windows Vista Access 2003
    Join Date
    Oct 2008
    Posts
    2
    I figured this out...Thanks

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

Similar Threads

  1. Calculated Query Field used in different Query
    By cakdhooper in forum Queries
    Replies: 0
    Last Post: 11-21-2008, 03:07 PM
  2. Query Help
    By gucc in forum Queries
    Replies: 0
    Last Post: 10-08-2008, 04:24 PM
  3. Like Query from VB
    By emilylu3 in forum Queries
    Replies: 0
    Last Post: 07-02-2007, 01:43 PM
  4. 2 of 4 query
    By PaulDouglas in forum Database Design
    Replies: 0
    Last Post: 07-26-2006, 08:04 PM
  5. Query
    By idareu in forum Queries
    Replies: 1
    Last Post: 05-05-2006, 02:10 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