I have a SharePoint 2007 (MOSS) list with 2 "Person or Group" columns which I would like to compare, essentially:
SELECT * FROM List WHERE (Analyst = Developer)
In my code (C#) I've built this as:
SPQuery itemQuery = new SPQuery();
itemQuery.Query = "<Where><Eq><FieldRef Name='Analyst' /><FieldRef Name='Developer' /></Eq></Where>";
SPListItemCollection queryResults = list.GetItems(itemQuery);
But this is throwing an exception ("Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)").
I've seen some information regarding the Type attribute of a Value element when comparing against a "Person or Group" column, but nothing about comparing two of these columns against each other.
I've also tried adding "LookupId='TRUE'" to each FieldRef, with no change.