Changed variant of SharePoint CAML OrderBy Modified

I made a request against the list. I want to get the last modified item that meets a certain condition and my request looks like this:

<Query><OrderBy><FieldRef  Name='Modified' Ascending='FALSE' /></OrderBy><Where><Eq><FieldRef Name='kortnummer'/><Value Type='String'>kv11</Value></Eq></Where></Query>

      

I get the list I want, just not in the correct order. Changing Ascending to true does nothing, so obviously there is something with OrderBy that doesn't fit.

According to MSDN, it can be ordered using Modified.

Any idea why my OrderBy isn't working?

+2


source to share


2 answers


I always add OrderBy after .

Otherwise, you can make sure to use the internal name. I usually use SharePoint Manager 2007 to get internal field names. Codeplex SharePoint manager



I see that in the list in my SharePoint, the internal name of the modified column is "Last_x0020_Modified".

+3


source


If you do this in a C # string to get the SPListItemCollection, you don't need the "<Query> </Query>" tags.



+1


source







All Articles