title: Use multiple Inner join for SQL query in VBA
body: <p>I want to run the sql queries via VBA excel below are my code which is successfully run for me for two table inner join.</p>
  
  <p>Now I want to edit the query in which i can combined more the 2 tables with the help of Inner join.</p>
  
  <pre class="lang-vb prettyprint-override"><code>    Sub SQL()
  
          Dim cn As ADODB.Connection
          Dim rs As ADODB.Recordset
  
          strFile = ThisWorkbook.FullName
          strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" &amp; strFile _
          &amp; ";Extended Properties=""Excel 12.0;HDR=Yes;IMEX=1"";"
  
          Set cn = CreateObject("ADODB.Connection")
          Set rs = CreateObject("ADODB.Recordset")
  
          cn.Open strCon
  
          strSQL = "SELECT [Sheet2$].[Sr], [Code], [Family] FROM [Sheet3$] INNER JOIN [Sheet2$] ON [Sheet2$].[Sr]=[Sheet3$].[Sr]"
  
  ''Here i want to edit the code to combined more the 2 tables with the help of Inner join.
  
          rs.Open strSQL, cn
  
          Sheet3.Range("D1").CopyFromRecordset rs
  
          End Sub
  </code></pre>
  
  <p>for example:- I have one more table in sheet 4 in which also the Sr header is available.Please guide me for the same.</p>
  
  <p><a href="https://i.stack.imgur.com/bq3XZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bq3XZ.png" alt="enter image description here"></a></p>