CAML Query for Week and Month not working

孤街醉人 提交于 2019-12-24 05:55:17

问题


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:


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



来源:https://stackoverflow.com/questions/15704978/caml-query-for-week-and-month-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!