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.