Page 3 of 3 FirstFirst 123
Results 31 to 32 of 32
  1. #31
    sai_rlaf is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    44
    I just wanted to check in, for 1, to say thank you so much for all the help today, and 2, to share my final query and explain what I did to get my returns.
    I parsed out each part of my last name into it's own field and compared it against our client list. I got about 1500 matches. I then did a parse of my first name and conditioned it to return it if the first name matched any part of the first name as well. I ended up with about 25 results. I copied my code. If i messed up on anything or didn't think it through enough, let me know.



    SELECT *
    FROM SDNList INNER JOIN ClientList ON SDNList.LastName = ClientList.LastName
    WHERE ClientList.FirstName = SDNList.FirstName OR ClientList.FirstName = SDNList.FirstName1 OR ClientList.FirstName = SDNList.FirstName2 OR ClientList.FirstName = SDNList.FirstName3
    UNION
    SELECT *
    FROM SDNList INNER JOIN ClientList ON SDNList.LastName1 = ClientList.LastName
    WHERE ClientList.FirstName = SDNList.FirstName OR ClientList.FirstName = SDNList.FirstName1 OR ClientList.FirstName = SDNList.FirstName2 OR ClientList.FirstName = SDNList.FirstName3 AND SDNList.LastName1 is Not Null
    UNION
    SELECT *
    FROM SDNList INNER JOIN ClientList ON SDNList.LastName2 = ClientList.LastName
    WHERE ClientList.FirstName = SDNList.FirstName OR ClientList.FirstName = SDNList.FirstName1 OR ClientList.FirstName = SDNList.FirstName2 OR ClientList.FirstName = SDNList.FirstName3 AND SDNList.LastName2 is Not Null
    UNION
    SELECT *
    FROM SDNList INNER JOIN ClientList ON SDNList.LastName3 = ClientList.LastName
    WHERE ClientList.FirstName = SDNList.FirstName OR ClientList.FirstName = SDNList.FirstName1 OR ClientList.FirstName = SDNList.FirstName2 OR ClientList.FirstName = SDNList.FirstName3 AND SDNList.LastName3 is Not Null
    UNION
    SELECT *
    FROM SDNList INNER JOIN ClientList ON SDNList.LastName4 = ClientList.LastName
    WHERE ClientList.FirstName = SDNList.FirstName OR ClientList.FirstName = SDNList.FirstName1 OR ClientList.FirstName = SDNList.FirstName2 OR ClientList.FirstName = SDNList.FirstName3 AND SDNList.LastName4 is Not Null
    UNION SELECT *
    FROM SDNList INNER JOIN ClientList ON SDNList.LastName5 = ClientList.LastName
    WHERE ClientList.FirstName = SDNList.FirstName OR ClientList.FirstName = SDNList.FirstName1 OR ClientList.FirstName = SDNList.FirstName2 OR ClientList.FirstName = SDNList.FirstName3 AND SDNList.LastName5 is Not Null

  2. #32
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Glad you got it all to work out. Congrats.

    Dont forget to mark the thread solved =P

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Stuck with combo boxes for ever !!! :(
    By Evgeny in forum Forms
    Replies: 9
    Last Post: 04-14-2010, 09:03 PM
  2. Stuck on Query
    By wes028 in forum Access
    Replies: 9
    Last Post: 01-14-2010, 08:33 AM
  3. Stuck on Join Query
    By Pimped in forum Queries
    Replies: 1
    Last Post: 10-26-2009, 10:54 AM
  4. Sigh, having used Access in 5 years and stuck..
    By Access Denied in forum Access
    Replies: 3
    Last Post: 10-06-2009, 02:19 PM
  5. Newbie Here & Stuck
    By FOZILD in forum Access
    Replies: 5
    Last Post: 09-24-2009, 08: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