title: Filter Between 2 date in ASP.NET MVC
body: <p>i want to filter or search between 2 date i write this code , but when i run the application the data which in the table not show what is the wrong ?</p>
  
  <p>This is my controller :</p>
  
  <pre><code>    public ActionResult Index(DateTime? start, DateTime? end)
      {
          var ExpenseDetails = _context.ExpenseDetails.Include(s =&gt; s.expenses).Where(t =&gt; t.DateExpense &gt;= start &amp;&amp; t.DateExpense &lt;= end).ToList();
  
          return View(ExpenseDetails);
      }
  </code></pre>
  
  <p>and this is View :</p>
  
  <pre><code>@using (Html.BeginForm())
  {
          &lt;div&gt;
              &lt;span&gt;Start Date :&lt;/span&gt; &lt;input type="date" name="start" /&gt;
              &lt;span&gt;End Date :&lt;/span&gt; &lt;input type="date" name="end" /&gt;
              &lt;input type="submit" value="Get Records Between Dates" /&gt;
          &lt;/div&gt;
          &lt;table&gt;
          @foreach (var item in Model)
          {
              &lt;tbody&gt;
                 &lt;tr&gt;
                      &lt;td&gt;
                           @Html.DisplayFor(modelItem =&gt; item.expenses.Expenses_Type)
                      &lt;/td&gt;
                      &lt;td&gt;
                          @Html.DisplayFor(modelItem =&gt; item.DateExpense)
                      &lt;/td&gt;
                      &lt;td&gt;
                          @Html.DisplayFor(modelItem =&gt; item.Amount)
                      &lt;/td&gt;                           
              &lt;/tbody&gt;
           }
          &lt;/table&gt;
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/XdNdN.gif" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p><a href="https://i.stack.imgur.com/SWRBO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SWRBO.png" alt="enter image description here"></a></p>
  
  <p>Thank you </p>