Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7853691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:46:16+00:00 2026-06-02T19:46:16+00:00

I have two tables that I need to compare and update values in one

  • 0

I have two tables that I need to compare and update values in one table if keywords appear in another reference table.

A is a data table that contains a list of individuals with separate fields for a last and first name.

B is another reference table that contains a defined list of individuals with last and first names.

I’m writing an update query in Access to check the individuals in table A to see if they are listed in table B and update a field in A to indicate whether or not they are listed in table B. I’m using the criteria that if the last and first name are the same in both tables, then it is sufficient to be a match. The problem is that names fields table A may contain additional information (such as titles or credentials) that is not in the reference table B, which only lists first and last name. I do not have control over the data in table A, but need to make a join based on like criteria, as best as possible.

I’m not sure how to express the following in SQL. I’m hoping the following pseudo-code, explains what I’m trying to accomplish:

UPDATE A
    SET A.[isinB]=true
WHERE

A.[lastname] contains B.[lastname]
and
A.[firstname] contains B.[firstname]

Example:

A.[lastname] = SMITH MD PHD
A.[firstname] = JOHN M

B.[lastname] = SMITH
B.[firstname] = JOHN

In this example, I want this to be considered a match, and A.[isinB] set to true.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:46:17+00:00Added an answer on June 2, 2026 at 7:46 pm

    In Access you can do a Wildcard compare:

    UPDATE A SET A.[isinB]=true
    WHERE
    B.[Firstname] Like "*" & A.[Firstname] & "*" AND B.[Lastname] Like "*" & B.[Lastname]
    

    The bookend ““‘s wildcards instruct Access to find the string anywhere within the field that “Like” references, ex. “JOHN” is within “JOHN M” will return true. You may want to consider just specifying the first ““, depending on your data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database two tables and a linking table that I need a
I have two tables that are related via a mapping table: keywords titles I
I have two tables that need the exact same values for denormalization purposes. Here's
I have a two tables that are Subject and chapter . I need to
Suppose I have two tables that are linked (one has a foreign key to
I have two tables: one table (okay, it's a view), vComputer, lists many computers
I have data from two spreadsheets where I need to compare the quantities of
I have two tables that need to be joined based on matching xml. The
i have two datasets and i need to compare these two datasets such that
I have two tables. One is holding the titles of games. Another is holding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.