title: C# comparing OrderDate to variable
body: <p>I have a variable, which differs between a day, a week, and a month. A form takes this and sends it back to the controller. However I am trying to get the "View orders within 1 week" to work using this method below. No errors, It just doesn't show any orders at all.</p>
  
  <pre><code>Controller; (Just trying to get it to work before i change the amount of days)
  else if (date == "day")
              {
                  DateTime today = DateTime.Now;
                  DateTime answer = today.AddDays(10);
  
                  return View(db.Orders.Where(x =&gt; x.OrderDate &lt;= answer).ToList());
              }
  </code></pre>
  
  <p>This is my view, including other parts I use;</p>
  
  <pre><code>@using (Html.BeginForm("Index", "EditOrders", FormMethod.Get))
  {
      //the following are search options
  
      &lt;b&gt; Search for: &lt;/b&gt;@Html.RadioButton("option", "FirstName") &lt;text&gt;First Name&lt;/text&gt; @Html.RadioButton("option", "PostalCode") &lt;text&gt; Post-Code &lt;/text&gt;
      @Html.RadioButton("option", "Username")&lt;text&gt;Email-Address&lt;/text&gt; @Html.TextBox("search")
      &lt;text&gt;Orders Made &lt;/text&gt;&lt;select id="date" name="date"&gt;
          &lt;option value="none"&gt;No day&lt;/option&gt;
          &lt;option value="day"&gt;In the last day&lt;/option&gt;
          &lt;option value="week"&gt;In the last week&lt;/option&gt;
          &lt;option value="month"&gt;In the last month&lt;/option&gt;
          &lt;option value="year"&gt;In the last year&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="submit" name="submit" value="Search" /&gt;
  }
  </code></pre>