CAML Query for Week and Month not working

2019-08-08 04:23发布

I following CAML Query does not work:

<Where><DateRangesOverlap><FieldRef Name=\"EventDate\" /><FieldRef Name=\"RecurrenceID\" /><Value Type=\"DateTime\"><Week /></Value></DateRangesOverlap></Where>

AND

<Where><DateRangesOverlap><FieldRef Name=\"EventDate\" /><FieldRef Name=\"RecurrenceID\" /><Value Type=\"DateTime\"><Month/></Value></DateRangesOverlap></Where>

But this one works:

<Where><DateRangesOverlap><FieldRef Name=\"EventDate\" /><FieldRef Name=\"RecurrenceID\" /><Value Type=\"DateTime\"><Yearly /></Value></DateRangesOverlap></Where>

The only difference is that the working query has <Yearly /> as Date time and the non working queries have <Week /> and <Month />.

This is a big issue for me as it has a big performance impact. Can someone provide some guidance as to what muight be happening here?

1条回答
Lonely孤独者°
2楼-- · 2019-08-08 05:19

The DateRangesOverlap has many issues, the one you are facing might be explained here: Issue. The same author has provided a solution Solution

查看更多
登录 后发表回答