Results 1 to 6 of 6
  1. #1
    jeroen4691 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    3

    Match data with different contents

    Hi,
    I have to match an ID number with the correct user. In one table I have the columns userID and full name including initials, in the other table I have columns first name and last name without the initials.

    table users:
    Voornaam Achternaam
    Els Worp van der

    Table ID:
    salnr naam achternaam
    3827 Worp, E.G.J.M. van der Worp

    the result from the query needs to give me a column with the first name, the salnr, and the naam field.



    How do I achieve this ?


    Thanks in advance,

    Jeroen4691

  2. #2
    admessing's Avatar
    admessing is offline GIS DBase Tamer
    Windows XP Access 2007
    Join Date
    Dec 2011
    Location
    Northern CO
    Posts
    79
    You likely need to add a primary key to one table and the same value as a foreign key in the other table....then it is just a matter of a simple SQL query.

  3. #3
    jeroen4691 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    3
    If it weren't so many records I would agree, however the full table holds about 3000 records, and how will I know which foreign/primary key to give to all those records?
    I would think to create something that joins "achternaam" and "naam" in such a way that i achieve a 100% match between these two fields..

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Before you can relate these tables, you need to get some level of consistency (level of detail/consistent granularity) in the fields you intend to relate.
    What does naam Worp, E.G.J.M. van der mean? Do all the naams have the same punctuation? Same field order? What if there are no initials?

    The best you will get is an approximation. It appears that you will have to manually determine if

    -E Worp = Els Worp van der

  5. #5
    jeroen4691 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    3
    All fields have the same punctuation, like lastname "comma" initials. the fiel I need to match is only "lastname" , so i need to find a filter to give me all lastnames before the "comma" .....

  6. #6
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Quote Originally Posted by jeroen4691 View Post
    Hi,

    table users:
    Voornaam Achternaam
    Els Worp van der

    Table ID:
    salnr naam achternaam
    3827 Worp, E.G.J.M. van der Worp
    Quote Originally Posted by jeroen4691 View Post
    All fields have the same punctuation, like lastname "comma" initials. the fiel I need to match is only "lastname" , so i need to find a filter to give me all lastnames before the "comma" .....
    Just trying to understand :

    If it is simply getting "Worp" from the naam field "Worp, E.G.J.M. van der" from Table ID, given the criteria that the SurName "Worp" in the naam field is essentially and immediately followed by a comma, then :
    Code:
    ExtractedLastName: Left([naam],InStr([naam],",")-1)
    which in turn can be used to join to the Achternaam from the Table Users.
    However, I notice that the table Users has Achternaam as "Worp van der".

    Also, is there no possibility of 2 Users having the same SurName.

    Thanks

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

Similar Threads

  1. Unstack Data and Match with Unique ID
    By lukejones in forum Queries
    Replies: 7
    Last Post: 02-24-2014, 08:33 AM
  2. Replies: 1
    Last Post: 12-21-2011, 02:11 PM
  3. Cannot match same data in different tables
    By jitendrakalyan in forum Queries
    Replies: 3
    Last Post: 11-22-2010, 12:26 PM
  4. data type mis match
    By cowboy in forum Programming
    Replies: 3
    Last Post: 03-12-2010, 11:54 AM
  5. Finding data that doesn't match
    By dlhayes in forum Queries
    Replies: 1
    Last Post: 11-11-2006, 08:14 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