title: Data type mismatch in MS Access SQL sub-query
body: <p>Alright, this query will not run and returns a data type mismatch error. This error did not start until I attempted to join two tables within the sub-query in the WHERE clause. </p>
  
  <p>The two tables I am attempting to join are the exact two tables that are joined in the primary query. Each table contains a column, CRD Number. In one table, it is stored as text, in the other, it is stored as number. This is why I have used the CStr() function to cast the numerical column as a textual column. This worked beautifully for the primary query (thank Stack Overflow!) but when I attempted to do the same exact join in the sub-query, I received the data type mismatch error. </p>
  
  <p>Here is a picture, with a small arrow and text box to highlight the area which I (99% sure) believe is causing the problem. Again, the problem only arose when I attempted to join these two tables in the sub-query. If the join is removed, the query will run. (Although the sub-query will not return the correct results, thus making my primary query useless) </p>
  
  <p><img src="https://i.stack.imgur.com/3Y7JJ.jpg" alt="My issue"></p>
  
  <p>*All my Access DB's are set to accept Standard T-SQL syntax, so I will also tag this as T-SQL</p>