2
var query = new SPQuery
{
  Query = "<OrderBy><FieldRef Name="Created" Ascending="False" /></OrderBy>",
  RowLimit = 100
};

Does this return the 100 most recently created items? I'm not confident that an order without a query will return the 100 most recent items.

I'm concerned this will return 100 random items, and THEN order by creation date. Does anyone know if this is true or false?

3

The OrderBy element specifies how to sort the items which will be returned. So this query will indeed return the 100 most recently created items and not random items.

You can use U2U CAML Builder to test such queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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