title: Why do my inner joins not work
body: <p>This is an embarassing question to ask! But I have not used tsql for some time now.</p>
  
  <p>I have 3 tables:</p>
  
  <ul>
  <li>Job</li>
  <li>Gallery</li>
  <li>JobWorkUnit</li>
  </ul>
  
  <p>The primary key of <code>Gallery</code> is linked to the corresponding foreign key in <code>Job</code>. The primary key of <code>JobWorkUnit</code> is linked to the corresponding foreign key in <code>Job</code></p>
  
  <p>I wish to return all the records on <code>Job</code> regardless of whether they have 'links' in the other 2  tables.</p>
  
  <p>I had thought that using <code>LEFT OUTER JOIN</code> is the way to do it but I get no records returned at all.</p>
  
  <p>Can someone please check my code?</p>
  
  <pre><code>SELECT 
      *
  FROM 
      Job J
  LEFT OUTER JOIN 
      Gallery G ON G.JobRef = J.JobRef
  LEFT OUTER JOIN 
      JobWorkUnit JWU ON J.JobRef = JWU.JobRef
  WHERE 
      J.Active = 1 
      AND G.Active = 1 
      AND JWU.Active = 1 
      AND J.CompanyRef = @CompanyRef
  </code></pre>
  
  <p>There are no records in <code>WorkUnit</code> or <code>Gallery</code></p>
  
  <p>If I remove:</p>
  
  <pre><code>AND G.Active = 1 
  AND JWU.Active = 1 
  </code></pre>
  
  <p>I get 2 records back so my <code>Where</code> clause is overriding my join type. Is that a fair thing to say?</p>