I'm building a report that pulls from a SharePoint list. I'd prefer to avoid using filters as the list is many thousand records and I'd like to just pull what I need rather than pull it all and try to filter. The SQL equivalent of what I'm trying to achieve would be:
Here is what I have come up with but it doesn't seem to be working as expected.
Once I pull the correct data, I can then group by category in the chart series, I'm just not having much luck getting exactly what I want. Open to other suggestions as well if I'm trying to put a square peg in a round hole.
Code:
where EventDate between @StartDate and @EndDate
and
(category like '%cat1%' or
category like '%cat2%' or
category like '%cat3%' or
category like '%cat4%')
Here is what I have come up with but it doesn't seem to be working as expected.
Code:
<Query>
<Where>
<Or>
<And>
<Geq>
<FieldRef Name="EventDate" />
<Value Type="DateTime">
<Parameter Name="StartDate" />
</Value>
</Geq>
<Leq>
<FieldRef Name="EventDate" />
<Value Type="DateTime">
<Parameter Name="EndDate" />
</Value>
</Leq>
</And>
<Or>
<Contains>
<FieldRef Name="category" />
<Value Type="Text">cat1</Value>
</Contains>
<Or>
<Contains>
<FieldRef Name="category" />
<Value Type="Text">cat2</Value>
</Contains>
<Or>
<Contains>
<FieldRef Name="category" />
<Value Type="Text">cat3</Value>
</Contains>
<Contains>
<FieldRef Name="category" />
<Value Type="Text">cat4</Value>
</Contains>
</Or>
</Or>
</Or>
</Or>
</Where>
</Query>
Once I pull the correct data, I can then group by category in the chart series, I'm just not having much luck getting exactly what I want. Open to other suggestions as well if I'm trying to put a square peg in a round hole.
