12

I have the following query:

<query> \
    <Query> \
        <Where><Eq><FieldRef Name='FSObjType'/><Value Type='Lookup'>0</Value></Eq></Where>\
        <OrderBy><FieldRef Name='Region' Ascending='True' /></OrderBy>\
    </Query> \
</query> \

Of which I'd like to adapat so that I'm ordering by region, and then ordering by location.

Basically, assuming this was SQL, my query would look like the following:

SELECT  *
FROM    LIST
ORDER BY 
        Region ASC, 
        Location ASC

I've tried the following with no success:

<query> \
    <Query> \
        <Where><Eq><FieldRef Name='FSObjType'/><Value Type='Lookup'>0</Value></Eq></Where>\
        <OrderBy><FieldRef Name='Region' Ascending='True' /></OrderBy>\
        <OrderBy><FieldRef Name='Location' Ascending='True' /></OrderBy>\
    </Query> \
</query> \

So I'm curious what the correct syntax is? How could I go about finding this?

21
<OrderBy>
    <FieldRef Name='Region' Ascending='True' />
    <FieldRef Name='Location' Ascending='True' />
</OrderBy>

Should be the correct syntax for the order by clause.

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.