Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Hey guys I am trying to get a list of items with a "Created" date range. The problem is that upon executing the query it seems to be completely ignoring the 5000 row limit.

<View Scope='Recursive'>
<Query>
<Where>
<And>
<Geq>
<FieldRef Name='Created' /><Value Type='DateTime'>2000-1-1</Value>
</Geq>
<Leq>
<FieldRef Name='Created' /><Value Type='DateTime'>2001-1-1</Value>
</Leq>
</And>
</Where>
</Query>
<RowLimit>5000</RowLimit>
</View>

If I delete the tags inside the Query Tag it then limits the rows to 5000. This is pretty strange and I don't understand why this is happening with my CAML query.

share|improve this question
    
Are you sure that the other parts of the CAML is correct though? Do you get results if you remove the RowLimit tag? –  tarjeieo May 29 '13 at 14:20
    
I used U2U in order to create my query. It should be just fine as it returned results in that application. –  Sharepointuser May 29 '13 at 14:22

2 Answers 2

The dates look malformed, you need to use ISO format: yyyy-MM-ddTHH:mm:ssZ

share|improve this answer

Use the SPUtility.CreateISO8601DateTimeFromSystemDateTime() in all your date time value so that your CAML query would work. for usage instruction see this Link

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.