I have this problem: I want to query a list using Caml. Here is the query:
<Where>
<And>
<Geq>
<FieldRef Name="Next_x0020_Oil_x0020_Change_x002" />
<Value Type="DateTime">
<Today />
</Value>
</Geq>
<Leq>
<FieldRef Name="Next_x0020_Oil_x0020_Change_x002" />
<Value Type="DateTime">
<Today OffsetDays="+7"></Today>
</Value>
</Leq>
</And>
</Where>
The internal name of the column I want to use is: Next_x0020_Oil_x0020_Change_x0020_Date
. I've checked it, it's correct.
However, as far as i know this name is too long and it's being cut to 32 charecters or: Next_x0020_Oil_x0020_Change_x002
.
In the code I use the query list.GetItems(caml)
and it appears to be ok, but when I try to iterate through the returned items it throws the exception.
One or more field types are not installed properly. Go to the list settings page to delete these fields.
Even more weird is that when I execute the query in the U2U caml Query Builder Tool, it does not show any errors and returns the exact rows that I need.
As far as I know there are no problems with the field types of the list. Even if there are, I don't know where to look. The exception does not give that kind of information and the logs are not very helpful either.
Any ideas?