title: Find all instances of a date in a date range - SQL Server
body: <p>I need to find the price for an item for each financial year end date in a date range. In this case the financial year is e.g. 31 March</p>
  <p>The table I have for example:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ItemID</th>
  <th>Value</th>
  <th>DateFrom</th>
  <th>DateTo</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>10</td>
  <td>'2019/01/01'</td>
  <td>'2021/02/28'</td>
  </tr>
  <tr>
  <td>1</td>
  <td>11</td>
  <td>'2021/03/01'</td>
  <td>'2021/05/01'</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p><a href="http://sqlfiddle.com/#!18/86151f" rel="nofollow noreferrer">SQL Fiddle</a></p>
  <p>The SQL would thus result in the above table to be:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ItemID</th>
  <th>Value</th>
  <th>DateFrom</th>
  <th>DateTo</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>10</td>
  <td>'2019/01/01'</td>
  <td>'2019/03/30'</td>
  </tr>
  <tr>
  <td>1</td>
  <td>10</td>
  <td><strong>'2020/03/31'</strong></td>
  <td>'2021/02/28'</td>
  </tr>
  <tr>
  <td>1</td>
  <td>11</td>
  <td>'2020/03/01'</td>
  <td>'2021/03/30'</td>
  </tr>
  <tr>
  <td>1</td>
  <td>11</td>
  <td><strong>'2020/03/31'</strong></td>
  <td>'2021/05/01'</td>
  </tr>
  </tbody>
  </table>
  </div>