views:

315

answers:

3

What do I use in the value to return results using the following CAML query in MOSS2007? The query is currently not returning any results. I have tried using the Account Name and the name displayed in the list but to now avail.

<Eq><FieldRef Name='Modified_x0020_By' /><Value Type='User'>domain\someusername</Value></Eq>
A: 

First of all, I see the internal name for the "Modified By" column is actually "Editor".

This worked for me:

<Where><Eq><FieldRef Name='Editor'/><Value Type='Text'>LastName, FirstName</Value></Eq></Where>
Kit Menke
A: 

Here is an example from a query I used on the tasks list (but should be about the same):

Query = String.Format(CultureInfo.CurrentCulture, 
 "<Where><Eq><FieldRef ID='{0}' /><Value Type='User'>{1}</Value></Eq></Where>",
 SPBuiltInFieldId.AssignedTo, 
 SPContext.Current.Web.CurrentUser.Name)

I used the id of the field instead of internal name though...might help you.

Johan Leino
A: 

OK I managed to get this working by searching on "Author" rather than "Modified_x0020_By".

Dan Ryan