title: Write a single query to search between two dates and when To date is not available then it should search greater then first date
body: <p>Write a single query to search between two dates and when To date is not available then it should search greater then first date.  </p>
  
  <p>For example: search between two dates, when both from and to dates are available </p>
  
  <pre><code>11-10-2015 to 11-10-2017
  </code></pre>
  
  <p>My query should also return result when To date is not available</p>
  
  <p>For example: I want to write single query without any if and else </p>