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?

1 Answer 1

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

Should be the correct syntax for the order by clause.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .