title: Access/SQL Server 2008 Join using Like not working
body: <p>I apologize ahead of time because this question is in various forms many times on this site, but none of the solutions I have tried implementing seem to work properly, and I cannot find an answered question that gets me the right answer. </p>
  
  <p>I am working in access for a co-worker, though it will probably be in SQL in the future once he can get a server set up. I am trying to join two tables using Like, which is easy enough, except that it just is not working properly. First, an example from each table:</p>
  
  <p>T1</p>
  
  <pre><code>+-------------------------+--------------------------------------------------------------+--------------+
  |LOCATION_CG_LOC_LEGACY_ID|LOCATION_CODE_DESC                                            |PI_LOW_SIDE_MW|
  +-------------------------+--------------------------------------------------------------+--------------+
  |55555-Opt01              |Autobot Transformer, 800/900 NETWORK, Optimus #1 - 800 NETWORK|5             |
  +-------------------------+--------------------------------------------------------------+--------------+
  |55555-Opt02              |Autobot Transformer, 800/900 NETWORK, Optimus #2 - 800 NETWORK|6             |
  +-------------------------+--------------------------------------------------------------+--------------+
  |55555-Opt03              |Autobot Transformer, 800/900 NETWORK, Optimus #3 - 800 NETWORK|6.5           |
  +-------------------------+--------------------------------------------------------------+--------------+
  </code></pre>
  
  <p>T2</p>
  
  <pre><code>+------+-----------------------------------------+------------+
  |DIVID |DMT Bank Name                            |5 Digit Code|
  +------+-----------------------------------------+------------+
  |647531|800/900 NETWORK, Optimus #1 - 800 NETWORK|55555       |
  +------+-----------------------------------------+------------+
  |647532|800/900 NETWORK, Optimus #2 - 800 NETWORK|55555       |
  +------+-----------------------------------------+------------+
  |647533|800/900 NETWORK, Optimus #3 - 800 NETWORK|55555       |
  +------+-----------------------------------------+------------+
  </code></pre>
  
  <p>I am trying to combine like items essentially, so that I can perform whatever queries I want. For now however, I am fine with a select all. I just need to combine like items. In T1, the first column [LOCATION_CG_LOC_LEGACY_ID] is a non-repeating unique item. In T2, [DIVID] is a non-repeating unique item. I was trying to query them together using </p>
  
  <pre><code>SELECT *
  FROM [Data Table 1] INNER JOIN [Data Table 2] ON (([t1].[LOCATION_CODE_DESC] Like [t2].[DMT Bank Name]
  OR [t2].[DMT Bank Name] Like [t1].[LOCATION_CODE_DESC]) AND ([T1].[LOCATION_CG_LOC_LEGACY_ID] Like [t2].[5 Digit Code] or [t2].[5 Digit Code] Like [T1].[LOCATION_CG_LOC_LEGACY_ID]));
  </code></pre>
  
  <p>Now, I think there is a problem with the second half of that join condition, but even using only the first half, I get ZERO results. However, if I edit the middle column in each table, then use the first half of that condition, it works perfectly. In other words, if I make the columns match exactly, the query seems to work, which defies the whole point in using a "like" join to begin with. </p>
  
  <p>I have not yet tried this in SQL Server, but I need to get it working in Access anyway as a proof of concept at least. Any help you wonderful ladies and gentlemen can give me would be appreciated, even if it is pointing me to another thread that I have missed like a dolt.</p>
  
  <p>Lastly, I am trying to avoid using VBA if possible. </p>