Results 1 to 5 of 5
  1. #1
    Christine Boissoin is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2005
    Posts
    9

    Similar Names

    My table contains a list of unique last names. I want to write a query that will return all names who have the same first (5) characters. For example:



    Smith
    Smithe
    Smithers

    Thanks.
    Christine

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    In your query put this in:

    FirstFive: left(lastname,5)

    Where lastname is the name of your surname field.

    Then in the criteria put in

    [Enter the first five characters to search]

    note this won't work if the person puts in anything but five characters but you can mitigate that with a LIKE

    like [Enter UP TO the first five characters of the last name] & "*"

    this still won't work if they put in 6 characters but it handles anything less than or equal to 5 characters.

  3. #3
    Christine Boissoin is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2005
    Posts
    9
    Thanks.

    I was hoping to have the query return all examples where names are similar without any run-time involvement.

    Smith
    Smithe

    and

    Wilks
    Wilkson

    etc.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Then create a stand alone query that just has two fields, FirstFive as listed in my previous post and TotalCounted: count(lastname)

    Link this to your existing query (also with the firstfive field) through the firstfive field and in the criteria of the firstfive from the query above put in >1

  5. #5
    Christine Boissoin is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2005
    Posts
    9
    Perfect - thanks very much for the assistance.
    Christine

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

Similar Threads

  1. Finding like or similar names
    By Laurie B. in forum Queries
    Replies: 1
    Last Post: 08-14-2011, 07:24 AM
  2. Query Entity Names, and Column Names
    By Accidental DBA in forum Queries
    Replies: 1
    Last Post: 07-22-2011, 02:38 PM
  3. Finding similar names between two tables.
    By Laurie B. in forum Access
    Replies: 1
    Last Post: 07-15-2011, 03:21 PM
  4. Replies: 5
    Last Post: 04-24-2011, 03:14 AM
  5. Customer Entry/Find Duplicate/Similar names
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-27-2010, 09:20 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