title: joining several tables with inner and outer.
body: <p>I'm trying to combine inner and outer join but can't get it to work. I have a total of 7 tables that needs to be joined together in one query. 
  First I only had 6 and had no problem as everything was inner joins. But now I've added a seventh table and can't get it right. I think I need to use OUTER JOIN somehow but don't know how. 
  I will only use 3 tables in this example because I think that I can manage to fix the rest if you help me get started. </p>
  
  <p>List of my tables:</p>
  
  <p>Table1=dbo.kala (This is the 7th table i added.</p>
  
  <p>Table2=dbo.ti</p>
  
  <p>Table3=dbo.ao</p>
  
  <pre><code>SELECT kala.kaldat
  From dbo.kala
  Where kala.kaldat Between '170407' AND '170410'
  </code></pre>
  
  <p>The above query returns the following result. </p>
  
  <pre><code>Result1
  |kaldat    |
  |2017-04-07|
  |2017-04-08|
  |2017-04-09|
  |2017-04-10|
  </code></pre>
  
  <p>.</p>
  
  <pre><code>SELECT ti.startdat, ti.artnr, ti.aonr, ti.aopos, ao.prodgr
  From dbo.ti
  INNER JOIN dbo.ao ON ti.aonr = ao.aonr AND ti.aopos = ao.aopos
  Where ti.startdat Between '170407' AND '170410'
  </code></pre>
  
  <p>The above query returns the following result.</p>
  
  <pre><code>Result2
  ti.startdat| ti.artnr| ti.aonr|ti.aopos|ao.prodgr|
  2017-04-07 | 123     | 0001   |10      |50       |
  2017-04-10 | 456     | 0002   |20      |60       |
  </code></pre>
  
  <p>The result I want is this (3). </p>
  
  <pre><code>Result3
  kala.kaldat| ti.artnr| ti.aonr|ti.aopos|ao.prodgr|
  2017-04-07 | 123     | 0001   |10      |50       |
  2017-04-08 |         |        |        |         |
  2017-04-09 |         |        |        |         |
  2017-04-10 | 456     | 0002   |20      |60       |
  </code></pre>
  
  <p>The join between dbo.kala and dbo.ti is on kala.kaldat = ti.startdat. </p>
  
  <p>Hopefully you guys understand what I'm trying to get through here. If not i apologize beforehand and will gladly try to explain better. Thanks in advance! </p>
  
  <p>*Note the remaining 4 tables that aren't in this example needs to be joined (INNER?) with dbo.ti. </p>