title: Datetime comparison in CAML Query for Sharepoint
body: <p>i'm trying to have some item from a sharepoint list, depends on date in a custom column.</p>
  
  <p>I've created my query with U2U Caml Builder, and that's worked but when I put it in my own code in my webpart, it always return to me all the items od the list.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>DateTime startDate = new DateTime(Int32.Parse(year), 1, 1);
              DateTime endDate = new DateTime(Int32.Parse(year), 12, 31);
              SPQuery q = new SPQuery();
              q.Query = "&lt;Query&gt;&lt;Where&gt;&lt;And&gt;&lt;Geq&gt;&lt;FieldRef Name='Publicate Date' /&gt;&lt;Value IncludeTimeValue='FALSE' Type='DateTime'&gt;" + SPUtility.CreateISO8601DateTimeFromSystemDateTime(startDate) + "&lt;/Value&gt;&lt;/Geq&gt;&lt;Leq&gt;&lt;FieldRef Name='Publicate_x0020_Date' /&gt;&lt;Value IncludeTimeValue='FALSE' Type='DateTime'&gt;" + SPUtility.CreateISO8601DateTimeFromSystemDateTime(endDate) + "&lt;/Value&gt;&lt;/Leq&gt;&lt;/And&gt;&lt;/Where&gt;&lt;/Query&gt;";
  
              SPListItemCollection allItem = library.GetItems(q);
  </code></pre>