SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list where IDs are not unique.

How can I make a CAML Query for this list so I can get all values for a particular ID This is my list:

 ID        Customer     LOB    PeriodOne  PeriodTwo   PeriodThree   
100003        SSD       GH      1521         215            855
100003        SSD       GF      7481         0               25
100003        SSD       TD      5498         325            241
100203        XDC       GH      2521         415            455
100203        XDC       GF      7481         12              55
100203        XDC       TD      588          125            231


share|improve this question

user7400's answer will query based on the built in SharePoint unique ID field, which this ID field is clearly not. You first need to determine the Internal Name of the ID field in your list - the tools mentioned can help, or, you can look at the query string of the Edit column page from list settings (noting that _ gets encoded as %5F). I think it's most likely ID_0.

The query would then be more like:

     <FieldRef Name='ID_0' />
     <Value Type='Number'>100003</Value>

(Assuming the field is a number and not text; if it is text, set Type="Text" instead)

share|improve this answer

This should give you a result set filtered by your particular ID

     <FieldRef Name='ID' />
     <Value Type='Counter'>100003</Value>

And you want to get yourself the CAML Query Builder (Download the 2007 version) or Designer. It'll save you a ton of time and effort!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.