Results 1 to 2 of 2
  1. #1
    FrankBone is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    4

    Query for not exact matches in two tables


    I have a table listing 50 commonly used terms and want to query another table for records containing those terms as just part of a field. For example one term might be "MERCHANT BANKCARD" and the field I want to query will have "MERCHANT BANKCARD 05292015 9995555467" or something similar that varies. I want to find all records that contain that sequence of text. Similar to using Like "MERCHANT BANKCARD*" but for a list. Does this make sense? Thanks for any help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Maybe:

    SELECT table2.* FROM table2, table1 WHERE table2.field LIKE "*" & table1.field & "*";

    or

    SELECT table2.* FROM table2, table1 WHERE InStr(table2.field, table1.field)>0;

    or

    SELECT table2.* FROM table2 WHERE DCount("*", "table1", "InStr('[field]', '" & [field] & "')>0")>0;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Exact Match Query
    By KCC47 in forum Queries
    Replies: 1
    Last Post: 11-07-2014, 10:21 AM
  2. Query for similar but not exact data
    By markdudley in forum Queries
    Replies: 4
    Last Post: 03-09-2012, 01:02 PM
  3. Replies: 3
    Last Post: 02-08-2011, 10:25 AM
  4. Help: Comparison query to find non-matches
    By 14erclimber in forum Queries
    Replies: 6
    Last Post: 06-09-2010, 09:29 AM
  5. Replies: 1
    Last Post: 05-18-2010, 12:05 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