SharePoint 2010 offers you the ListViewByQuery control for displaying a list view according to a specified query. While I was trying to do so I got an error saying that “One or more field types are not installed properly. Go to the list settings page to delete these fields.” which was strange since I was querying a simple task list with no custom fields.
Problem description
You can see the error I described in the picture below:

The code which produced the error was the following:
MyCustomView = new ListViewByQuery();
MyCustomView.List = currentWeb.Lists["Tasks"];
SPQuery query = new SPQuery(MyCustomView.List.DefaultView);
query.ViewFields = "<FieldRef Name='Title' /><FieldRef Name='Due' />";
query.Query = "<Where><Leq><FieldRef Name='Due' />" +
"<Value Type='DateTime'>" +
SPUtility.CreateISO8601DateTimeFromSystemDateTime(filterDate.SelectedDate) +
"</Value></Leq></Where>";
MyCustomView.Query = query;
As you can see in line 4 and 5 I used a FieldRef Name='Due' which has to be FieldRef Name='DueDate'.
Solution
So here is the working code:
MyCustomView = new ListViewByQuery();
MyCustomView.List = currentWeb.Lists["Tasks"];
SPQuery query = new SPQuery(MyCustomView.List.DefaultView);
query.ViewFields = "<FieldRef Name='Title' /><FieldRef Name='DueDate' />";
query.Query = "<Where><Leq><FieldRef Name='DueDate' />" +
"<Value Type='DateTime'>" +
SPUtility.CreateISO8601DateTimeFromSystemDateTime(filterDate.SelectedDate) +
"</Value></Leq></Where>";
MyCustomView.Query = query;
The code above works with SharePoint 2010 Beta.