Question

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.

No correct solution

OTHER TIPS

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 ;-) ]

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top