How would I write this SQL as CAML?
CurrentDate = Now()
StartDate = '1-1-2018 12:00 AM'
EndDate = '1-1-2018 11:59 PM'
SELECT * FROM Calendar as c
WHERE (c.EventDate <= CurrentDate AND c.EndDate >= CurrentDate)
OR (c.EventDate <= StartDate AND c.EndDate <= EndDate)
This link looked good but didn't work for what I am trying to do.
This is the CAML I have but it doesn't work, I get an error undefined:
<View>
<Query>
<Where>
<Or>
<Leq><FieldRef Name='EventDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T00:00:00-0400</Value></Geq>
<Geq><FieldRef Name='EndDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T00:00:00-0400</Value></Leq>
<Or>
<Leq><FieldRef Name='EventDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T00:00:00-0400</Value></Leq>
<Geq><FieldRef Name='EndDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T23:59:59-0400</Value></Geq>
</Or>
</Or>
</Where>
</Query>
</View>