I'm having some trouble getting a CAML Query working against a very simple list.
My custom list has the fields:
- Person : User
- Date : Date
- Amount : Lookup
My query looks like this:
<Query>
<Where>
<Eq>
<FieldRef Name='Person' LookupId='TRUE' />
<Value Type='Integer'>{0}</Value>
</Eq>
</Where>
</Query>
and {0} contains an integer.
Problem
My list contains 8 elements, divided between two seperate users. My query is supposed to get me 4 elements back, but is always returning 8.
I have been researching this for quite some time now (using both U2U Query Builder, and trying to handwrite it) but have been unable to get it to filter.
Please advise!
Solution
The solution was to remove the <Query></Query>
from the CAML Query-string. The below accepted answer doesn't adress this, though it is also correct.