So, I have been using this query in my SharePoint app for Months and its has always worked perfectly fine. But i just realized that if the week I'm trying to get has a split month like July 31st to August 4th, it will only return List Items for July 31st??? I've tried everything I can think of to get this to work and nothing. How do I get it to work? I'm at a loss.
<View>
<Query>
<Where>
<And>
<Geq>
<FieldRef Name='EstimatedDelivery'/>
<Value IncludeTimeValue='TRUE' Type='DateTime'>startDate</Value>
</Geq>
<Leq>
<FieldRef Name='EstimatedDelivery'/>
<Value IncludeTimeValue='TRUE' Type='DateTime'>endDate</Value>
</Leq>
</And>
</Where>
</Query>
</View>
Here is the Javascript code
startDate = startDate.toISOString();
endDate = endDate.toISOString();
var camlQuery = new SP.CamlQuery();
var filterString = '<View><Query>';
filterString = filterString + '<Where>';
filterString = filterString + '<And>';
filterString = filterString + '<Geq>';
filterString = filterString + '<FieldRef Name=\'EstimatedDelivery\'/>';
filterString = filterString + '<Value IncludeTimeValue=\'TRUE\' Type = \'DateTime\'>' + startDate + '</Value>';
filterString = filterString + '</Geq>';
filterString = filterString + '<Leq>';
filterString = filterString + '<FieldRef Name=\'EstimatedDelivery\'/>';
filterString = filterString + '<Value IncludeTimeValue=\'TRUE\' Type = \'DateTime\'>' + endDate + '</Value>';
filterString = filterString + '</Leq>';
filterString = filterString + '</And>';
filterString = filterString +'</Where>';
filterString = filterString + '</Query></View>';