SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I write this code, and I try to group by Ascending or Descending.

<Query> <Where> <Neq> <FieldRef Name='Nazwisko' /> <Value Type='Note'>" "</Value> </Neq> </Where> <OrderBy> <FieldRef Name='Nazwisko' Ascending='False' /> </OrderBy> </Query>

But it no work. How Could I manage to group elements?

share|improve this question
Try removing the <Query> tag. – TZHX Dec 12 '12 at 13:09
up vote 1 down vote accepted

If your query is correct and you use these lines of code

SPQuery query = new SPQuery;
query.Query = "your query string"

You should remove <Query> tag from your sting

<Where><Neq><FieldRef Name='Nazwisko' /><Value Type='Note'>" "</Value></Neq></Where> <OrderBy><FieldRef Name='Nazwisko' Ascending='False' /></OrderBy>

Also I'm not sure about note field, did you try to test your query in U2U Caml Query Builder?

share|improve this answer
I made this query there and its no work on U2U Caml Query Builder – Grzegorz Z Dec 12 '12 at 13:24
remove <Query> from your query – Alexander Dec 12 '12 at 13:31
Okey now its worked fine :) – Grzegorz Z Dec 12 '12 at 13:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.