0

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>
Dan Ryan
  • 624
  • 7
  • 24

3 Answers3

1

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
  • 7,046
  • 1
  • 32
  • 54
0

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
  • 3,473
  • 1
  • 26
  • 27
0

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

Dan Ryan
  • 624
  • 7
  • 24
  • `Author` is the internal name for "Created by" ... if you want to query "Modified by", that's `Editor`. – Hinek Nov 19 '14 at 06:49