title: SQL to Access - Sum Case to IFF
body: <p>I have following SQL code that needs to be converted to MS Access SQL view.</p>
  
  <pre><code>sum(case when DATEDIFF(d, A.DUEDATE, getdate()) &lt; 31 
       and A.TYPE &lt; 7 then A.AMT
  when DATEDIFF(d, A.DOEDATE1, getdate()) &lt; 31 
       and A.TYPE &gt; 6 then A.AMT *-1
  else 0
  end) [Current]
  </code></pre>
  
  <p>I'm stuck after this:</p>
  
  <pre><code>Sum(IIF(Datediff(d, A.DUEDATE, Now())&lt;31
  </code></pre>