Results 1 to 4 of 4
  1. #1
    eschmidt12 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    8

    Joining fields - one table's string value is contained in the other table's value

    Hi guys,



    First post here. I'm trying to join two fields in which the string values from one table are contained in the string values of the other. For example, one field might have a value of DEA, where the other table would contain 2FADEAMR, and another might have ADEATRF1. To filter for this, using *DEA* as a criteria works just fine for retrieving the records I'm looking for.

    Is there a way to do this through a join, or do I have to create a subquery to extract the strings that I'm looking for? If I need to create a subquery to generate a field of "trimmed" values for the 2nd table, how would I do this?

    Let me know if this doesn't make sense.

    Thanks!!

    E

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If the embedded string were always in the same place, could use Left or Mid function to extract. However, I don't see any consistency to the string structure and consistency is essential when parsing data.

    Why is this value not broken into separate fields to begin with?

    I tried a LIKE operator with wildcards and didn't work.
    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.

  3. #3
    eschmidt12 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    8
    Quote Originally Posted by June7 View Post
    If the embedded string were always in the same place, could use Left or Mid function to extract. However, I don't see any consistency to the string structure and consistency is essential when parsing data.

    Why is this value not broken into separate fields to begin with?

    I tried a LIKE operator with wildcards and didn't work.
    Not sure why the field isn't separated, but unfortunately it is a field generated by the system that likely will never change.

    My criteria is LIKE "*" & [Enter value] & "*", this seems to work.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Generated by what system?

    That will work to filter records but not to join tables. The join was what I tried.
    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. Replies: 5
    Last Post: 08-06-2013, 01:32 PM
  2. Replies: 3
    Last Post: 06-28-2013, 01:59 PM
  3. Replies: 2
    Last Post: 06-05-2013, 03:18 PM
  4. Replies: 1
    Last Post: 07-06-2012, 05:32 PM
  5. Replies: 2
    Last Post: 08-09-2010, 08:13 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