I added this code to my sharepoint content query web part, which is looking at an events list from my calendar, .webpart file in order to only show recurring events within the next month and regular events within the next month. However, I can't get the web part imported and working. Also is there any way to replace <Month />
with a range like <Today:Today OffsetDays="30"/>
except with valid code?
Here is the code:
<property name="QueryOverride" type="string">
<Where>
<Or>
<And>
<Neq>
<FieldRef Name="FRecurrence"/>
<Value Type="Recurrance">1</Value>
</Neq>
<And>
<Lt>
<FieldRef Name="EventDate" Type="DateTime"/>
<Value Type="DateTime"><Today OffsetDays="30"/></Value>
</Lt>
<Gt>
<FieldRef Name="EventDate" Type="DateTime"/>
<Value Type="DateTime"><Today /></Value>
</Gt>
</And>
</And>
<DataRangesOverlap>
<FieldRef Name="EventDate" />
<FieldRef Name="EndDate" />
<FieldRef Name="RecirrenceId" />
<Value Type="DateTime"><Month /></Value>
</DataRangesOverlap>
</Or>
</Where>
</property>
When I upload this I get "Unable to add selected web part(s). The file format is not valid"
and when I add <![CDATA[
and ]]>
I can import it but the query doesn't return anything.
How can I get this to work?