When you use SPQuery you could get this message. This is probably because the INTERNAL name of the field is different than the display name.
Having this code with this field “Unit Id” (Internal name “UnitId”) we could get the error because we are referring the name with a space.
Incorrect:
string camlQuery = @"<Where><Eq><FieldRef Name='Unit Id' /><Value Type='Text'>" + UnitID + @"</Value>
</Eq></Where>";
Correct:
string camlQuery = @"<Where><Eq><FieldRef Name='UnitId' /><Value Type='Text'>" + UnitID + @"</Value>
</Eq></Where>";