1

I have column name OrderBy of Type Number:

enter image description here

I am using below CAML Query:

"<View><Query><OrderBy><FieldRef Name='OrderBy'  Ascending='TRUE' /> 
</OrderBy></Query></View>";

In OrderBy Column I have following values:

  • 2
  • 2.1
  • 2.5
  • 2.9
  • 2.10

So Expected result should be in following order:

  • 2
  • 2.5
  • 2.9
  • 2.10

But Actual result is

  • 2
  • 2.10
  • 2.1
  • 2.5
  • 2.9

So my CAML query is not working as expected, please help.

  • 1
    I guess the actual result is correct and it is in Ascending order only. – Ganesh Sanap Jul 23 '19 at 6:37
1

Two Options!

  1. the function works properly but uses some strange string sorting on decimal values
  2. the function is not running at all, because the name in your FieldRef is propable wrong. I have something in mind that 'space' in Fieldnames ist masked as '_x0020_'. So maybe it works better with

    FieldRef Name='Order_x0020_By'

[ inofficial option 3: I'm wrong with everything I wrote ;-) ]

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.