Filtering Data Using CAML Query

While filtering data using CAML query for date time sharepoint ignores time part, if we want to have filter on time as well, then how to achieve this.e.g. Query will be like this to achieve above requirement

“<Where><Eq><FieldRef Name=\”EndDate\” /><Value Type=\”DateTime\” IncludeTimeValue=’TRUE’>” + SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Now) + “</Value></Eq></Where>”

The good practice is to have date time using SPUtiliy class and we need to add attribute IncludeTimeValue=’TRUE’ in the query to have time consideration in filtering process.

~ by Neha Sinha on February 21, 2008.

2 Responses to “Filtering Data Using CAML Query”

  1. cool.. thanks

  2. Hi Neha,
    Thanks a lot ,It did a great help to me.

Leave a Reply