I've been struggling with this all day. I've referenced several SO questions/answers but to no avail. Not quite sure what I'm doing wrong. I also cannot use a CAML Builder, unfortunately, due to some security restrictions.
Here is my custom list, users:
LastName | FirstName | NameID
I'm trying to write my CAML query to say, WHERE (LastName = X AND FirstName = Y) OR NameID = Z
I can do the first part just fine, grabbing where LastName = X and FirstName = Y.
<Where>
<And>
<Eq>
<FieldRef Name='LastName' />
<Value Type='Text'>Doe</Value>
</Eq>
<Eq>
<FieldRef Name='FirstName' />
<Value Type='Text'>John</Value>
</Eq>
</And>
</Where>
But as soon as I try to say that statement OR where NameID = Z, I run into issues. I've tried several queries, my latest being:
<Where>
<And>
<Eq>
<FieldRef Name='LastName' />
<Value Type='Text'>Doe</Value>
</Eq>
<Eq>
<FieldRef Name='FirstName' />
<Value Type='Text'>John</Value>
</Eq>
<Or>
<Eq><FieldRef Name='Name' /><Value Type='Text'>JDoe123</Value></Eq>
</Or>
</And>
</Where>
Can anyone point me in the right direction?