CAML query not considering time for Date and time field

October 29th, 2009 | Categories: Programming, SharePoint

If you’re having trouble constructing your CAML query and you have a DateTime field with time enabled, the important fact that plain 2009-10-28T10:00:00Z will ignore the time part of the query. It is useful for querying whole days. If Time part of the DateTime field is also important to consider (you’re querying specific time of the day, you have to add parameter IncludeTimeValue="TRUE" parameter. So the whole CAML node would be

IncludeTimeValue="TRUE" Type="DateTime">2009-10-28T10:00:00Z

Thanks, ucsharp for publishing this.