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 used DateRangesOverlap for fetching calendar events with recurring set to TRUE.

Below is the code :

SPQuery query = new SPQuery();
DateTime startDate = new DateTime(2009, 2, 1);
query.ExpandRecurrence = true;
query.CalendarDate = startDate;
query.Query = "<Where><DateRangesOverlap><FieldRef Name=\"EventDate\" /><FieldRef Name=\"EndDate\" /><FieldRef Name=\"RecurrenceID\" /><Value Type=\"DateTime\"><Now /></Value></DateRangesOverlap></Where>";
SPListItemCollection myItems = myList.GetItems(query);

My past events are not there.

I have mentioned the start date as below:

CalDate = new DateTime(2009,2,1)

But didnt worked out.. My calendar starts from today's date.

share|improve this question
          <FieldRef Name='EventDate' />
          <FieldRef Name='EndDate' />
          <FieldRef Name='RecurrenceID' />
          <Value Type='DateTime'>

Instead of <Now /> use <Today/>

Ref : CAML Queries, DateRangesOverlap, and Today, oh my!, see the comment on blog too!

share|improve this answer

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.