title: setting a default value for a field in a where clause if it's null
body: <p>I want to set a default value for a date field of today within the query if it has not been set.  Basically I want to use a default value for any dates that are NULL within the where clause.  Below is perhaps an idea using pseudo code.</p>
  
  <pre><code>SELECT id
  FROM coupons
  WHERE expiration_date BETWEEN start_date
  AND (IF end_date IS NULL THEN RETURN current_date ELSE RETURN end_date)
  </code></pre>