title: The expression contains undefined function call DATEADD() | FilterExpression | Datetime filter
body: <p>I have a grid-view and I want to filter it to display data only in a certain date interval (from date A to date B, include A and B)</p>
  
  <p>I use SqlDataSource and FilterExpression, initially I use this FilterExpression:</p>
  
  <pre><code>FilterExpression="Submitted_time &gt;= '{0}' AND Submitted_time &lt;= '{1}'"&gt;
  </code></pre>
  
  <p>But data in {1} date is not included in the result (although I use <strong>'&lt;='</strong>) (probably because of time (hour/minute) so I managed to add 1 day to the {1}:</p>
  
  <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:CTECS %&gt;" SelectCommand="SELECT * FROM [Event] ORDER BY [Id] DESC"
                          FilterExpression="Submitted_time &gt;= '{0}' AND Submitted_time &lt;= DATEADD(day, 1, '{1}')"&gt;
                          &lt;FilterParameters&gt;
                              &lt;asp:ControlParameter Name="FromDate" ControlID="oCalendar1" PropertyName="SelectedDate" DefaultValue="1/1/1800" Type="DateTime" /&gt;
                              &lt;asp:ControlParameter Name="ToDate" ControlID="oCalendar2" PropertyName="SelectedDate" DefaultValue="1/1/3000" Type="DateTime" /&gt;
                          &lt;/FilterParameters&gt;
                      &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>But then Visual Studio give me : <strong><em>The expression contains undefined function call DATEADD()</em></strong></p>
  
  <p>Any solution here, my objective is only to include the data of the date {1} to the result...</p>