I'm using SPSiteDataQuery to fetch list contents from 2 different lists.
- List A) has the fields CustomField and Title
- List B) has only Title
Is it possible to build a (filter) query with nonexistent fields?
The aim is, to use one query for the 2 lists and handle everything with 1 SPSiteDataQuery. The query in this manner, throws an exception on list B)
<Query xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<Where>
<Or>
<Contains><FieldRef Name='CustomField' /><Value Type='Text'>Test</Value></Contains>
<Contains><FieldRef Name='Title' /><Value Type='Text'>Test</Value></Contains>
</Or>
</Where>
</Query>
EDIT
Thanks for your suggestions!
But setting nullable, doesn't work for me, although it sounds like the correct way to do it. I will use one SPSiteDataQuery now for each of the two lists and merge the results (I'll also check SPQuery against it for performance issues).