title: Getting results within two dates range
body: <p><code>MySQL</code> table have 3 rows.</p>
  
  <p><strong>Table:</strong></p>
  
  <pre><code>| ID | StartDate  | EndDate      |
  |:--:|:----------:|:------------:|
  | 1  | 2014-07-01 | 2014-07-31   |
  | 2  | 2014-07-15 | 2014-08-15   |
  | 3  | 2014-08-01 | 2014-08-31   |
  </code></pre>
  
  <p><strong>Visual example:</strong></p>
  
  <pre><code>| 07-01 07-31 | 08-01 08-31 |
  |:-----------:|:-----------:|
  | &lt;result 1&gt;  |             |
  |         &lt;result 2&gt;        |
  |             | &lt;result 3&gt;  |
  </code></pre>
  
  <p>I'm providing two dates, <kbd>Start Date</kbd> and <kbd>End Date</kbd>. </p>
  
  <p><strong>Question:</strong></p>
  
  <p>After setting <kbd>Start Date</kbd> to <code>2014-07-01</code> and <kbd>End Date</kbd> to <code>2014-07-31</code> I need to get <code>result 1</code> and <code>result 2</code>. </p>
  
  <p>What is best way of doing this?</p>
  
  <hr>
  
  <p><strong>Edit:</strong></p>
  
  <p>End up doing this:</p>
  
  <pre><code>SELECT id, StartDate, EndDate FROM table
  
  WHERE (
      (StartDate BETWEEN DATE('2014-07-01') AND DATE('2014-07-31'))
      OR
      (EndDate   BETWEEN DATE('2014-07-01') AND DATE('2014-07-31'))
  );
  </code></pre>
  
  <p>Thanks to <code>Yograj Sudewad</code> and <code>Sadikhasan</code>. You guys are awesome!</p>