Skip to main content
1 of 2
Revenant_01
  • 169
  • 1
  • 5
  • 19

get the items in descending order using caml query

i am trying to get the comments from Comment List in a 'Descending' order , the query that i am using is :

"<Where>" +
 "<Eq>" +
    "<FieldRef Name='TopicID' /><Value Type='Text'>" + ProjectID + "</Value>" +
   "</Eq>" +
      " <OrderBy>"+
   "<FieldRef Name='Created' Ascending='False' />"+
       " </OrderBy>"+  "</Where>";

but this query gives me the result in 'Ascending' order even if i set it to false. what is wrong here?

Revenant_01
  • 169
  • 1
  • 5
  • 19