title: Using if statement in where clause
body: <p>With if in a where statement I'm trying to get all rows where datetime is larger then NOW(), but if type = 'economy', i would like to constraint it to only show if datediff between datetime and NOW() is larger than 14 days.</p>
  
  <p><strong>Something like:</strong></p>
  
  <pre><code>Select type,date(datetime) as date
  from tbl1
  where datetime &gt; NOW()
  IF(type = 'economy') &amp;&amp; datediff(datetime,NOW()) &gt; 14
  order by datetime desc
  </code></pre>
  
  <p>I've tried with case when also, but can't figure it out...</p>