SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to filter a list based on the year as parameter. For e.x. if i use 2014, all items from 1/1/2014 to 31/12/2014 should appear and also i am filtering on region. For the caml query below, if there is an item which was entered on 1/1/2014, it does not show up.Any idea why...

        <FieldRef Name='Region' />
        <Value Type='Lookup'>A1.1</Value>
           <FieldRef Name='DueDate' />
           <Value IncludeTimeValue='FALSE' Type='DateTime'>2014-01-01</Value>
           <FieldRef Name='DueDate' />
           <Value IncludeTimeValue='FALSE' Type='DateTime'>2014-12-31</Value>
  <FieldRef Name='DueDate' Ascending='False' />
share|improve this question
Check this out:… ;) – RJ Cuthbertson Feb 11 '14 at 18:11

You need to use the ISO 8601 DateTime format:


Even if you aren't comparing against the time value, the ISO 8601 format is still expected.

Given DateTime dueDate You can use:

<Value IncludeTimeValue='FALSE' Type='DateTime'>dueDate.ToString("yyyy-MM-ddTHH:mm:ssZ")</Value>

Or the SPUtility.CreateISO8601DateTimeFromSystemDateTime() method:

<Value IncludeTimeValue='FALSE' Type='DateTime'>SPUtility.CreateISO8601DateTimeFromSystemDateTime(dueDate)</Value>

See SharePoint 2010 Working with Dates in CAML

share|improve this answer
thanks , it works now – Stan Feb 13 '14 at 16:06
Happy to help :) Please accept the answer if it worked for you. – RJ Cuthbertson Feb 13 '14 at 16:33
Like this solutions but how can i offset the dates using any of these methods? – naijacoder Dec 18 '14 at 5:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.