title: Access IIF expression convert to SQL
body: <p>I inherited an Access query with the following IIF statement which I am trying to convert into a SQL Where condition.  I have played with this for a couple of days cannot get it to return the same results.  Any help would be appreciated.</p>
  
  <p>Access</p>
  
  <pre><code>WHERE (((IIf([EFFDATE]-[MATDATE]&lt;&gt;[PDU_DAYS]-1 And [Calc_Type]="Cycles",IIf([PDU_DAYS] Between [30DayDQMin]+1 And [89DayDQMax]+1,"Yes","No"),IIf([PDU_DAYS] Between 31 And 90,"Yes","No")))="Yes"));
  </code></pre>
  
  <p>For the SQL code I have been playing around with various Boolean statements such as the following.  I have also tried building some case logic.  No luck so far.</p>
  
  <pre><code>([EffDATE]-[MatDate] &lt;&gt; [PDU_Days]-1 and CalcType = 'Cycles' and PDU_Days Between [30DayDQMin]+1 and [89DayDQMax]+1 or PDU_Days Between 31 and 90)
  </code></pre>