title: Conditional Clause in Where Access SQL
body: <p>I'm looking to add a conditional IIf or CASE to a WHERE clause in Access SQL to add an either/or condition based upon a passed value. I've seen a couple of examples on the site, but they were a little different and I have struggled to get the code to work in my case. The code: </p>
  
  <pre><code>SELECT * FROM incHC 
  WHERE 
  incHC.repdte=(SELECT Max(repdte) AS maxDt FROM bYrs) AND 
  incHC.asset&gt;0 AND 
  incHC.eq2&lt;&gt;0 AND 
  
  (
  CASE WHEN recType="inst" THEN 
    incHC.orphan=0
  ELSE
    incHC.orphan&lt;=1
  END
  )
  </code></pre>
  
  <p>Any help is much appreciated.</p>