0

Can someone tell me how the VB CAML Query would go to select the most recently created List item where 'FullName' field = 'Joe Smooth'.

Using Silverlight 5, SharePoint Client Object Model, VB.Net and a list called 'Staff'.

Thanks.

0

You can try either this:

<View>
<RowLimit>1</RowLimit>
<Query>
   <OrderBy>
      <FieldRef Name='Created' Ascending='False' />
   </OrderBy>
   <Where>
      <Eq>
          <FieldRef Name='Name' />
          <Value Type='Text'>Joe Smooth</Value>
      </Eq>
   </Where>
</Query>
</View>

OR

<View> 
<RowLimit>1</RowLimit> 
<Query> 
   <OrderBy> 
      <FieldRef Name='ID' Ascending='False' /> 
   </OrderBy>
   <Where>
      <Eq>
          <FieldRef Name='Name' />
          <Value Type='Text'>Joe Smooth</Value>
      </Eq>
   </Where> 
</Query> 
</View>

This should get you the last inserted item in a List

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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