title: How to get all dates between two dates in sql server
body: <p>I want to get all dates between <code>startend</code> and <code>Enddate</code>.I used between to get the desired result. But the between function skipping  the current date.</p>
  
  <pre><code>Declare @StartDate Datetime  ='2014-04-01 11:13:37'
                 ,@EndDate datetime ='2014-04-04 11:13:37'
  </code></pre>
  
  <p>Query:-</p>
  
  <pre><code>Select * from table where date between @Startdate and @EndDate
  </code></pre>
  
  <p>Current Result:-</p>
  
  <pre><code>2014-04-02 11:13:37
  2014-04-03 11:13:37
  2014-04-04 11:13:37
  </code></pre>
  
  <p>Expected result:-</p>
  
  <pre><code>2014-04-01 11:13:37
  2014-04-02 11:13:37
  2014-04-03 11:13:37
  2014-04-04 11:13:37
  </code></pre>