0

I want to be able to check if (1 = 1) AND (2=2 OR 3=3)

this is the following code i've tried so far:

"<View>" +
"<Query>" +
"<Where>" +
"<And>" +
"<Eq><FieldRef Name='Title'/><Value Type='Text'>" + namn + "</Value></Eq>" +
"<Or>" +
"<Eq><FieldRef Name='Prioritet'/><Value Type='Text'>Hög</Value></Eq>" +
"<Eq><FieldRef Name='Status'/><Value Type='Text'>Startad</Value></Eq>" +
"</Or>" +
"</And>" +
"</Where>" +
"</Query>" +
"</View>");
5
  • Please put parenthesis in what you want to check. It's not possible to provide answer as it differs whether you want to do "(1 = 1 and 2=2) or 3=3" or "1 = 1 and (2=2 or 3=3)". Currently your query does "1 = 1 and (2=2 or 3=3)". Commented Jun 4, 2015 at 8:53
  • @JussiPalo edited! Commented Jun 4, 2015 at 8:54
  • It looks good to me, you getting some error that query is malformed, or not the desired result? Commented Jun 4, 2015 at 8:55
  • @JussiPalo Failed to load resource: The server responded with a status of 403(forbidden) Commented Jun 4, 2015 at 9:03
  • Issue is not with CAML, please post the surrounding code. Commented Jun 4, 2015 at 11:13

1 Answer 1

0

Remove the view and query tags from the CAML, are you facing any error?

 "<Where>" +
"<And>" +
"<Eq><FieldRef Name='Title'/><Value Type='Text'>" + namn + "</Value></Eq>" +
"<Or>" +
"<Eq><FieldRef Name='Prioritet'/><Value Type='Text'>Hög</Value></Eq>" +
"<Eq><FieldRef Name='Status'/><Value Type='Text'>Startad</Value></Eq>" +
"</Or>" +
"</And>" +
"</Where>"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.