8

I have a list with an URL-field. Nothing special, just the OOTB Hyperlink-field.

I want to execute a CAML-query that selects items with a certain value in the description part of the URL-field.

CAML

<Query>
  <Where>
    <Contains>
      <FieldRef Name="URL" />
      <Value Type="URL">text</Value>
    </Contains>
  </Where>
</Query>

Result Only items with 'text' in de url part are selected, if a item has 'text' in the description part it is not selected.

How do i select items based the description of the URL?

Alex Angas
  • 5,961
  • 9
  • 49
  • 89
Dribbel
  • 2,906
  • 3
  • 31
  • 45

1 Answers1

8

I'm pretty sure you won't be able to do this with a CAML query. This is because for 'complex' fields which store multiple values, only the 'default' value is available to query - by this I mean what would be available when SPField.GetFieldValueAsText() is called.

This would mean the only way to 'query' like this is to iterate through the items in the list.

Chris O'Brien - MVP
  • 3,655
  • 18
  • 14
  • 1
    Thanks, for now i just added an extra column which duplicates the value of the description and use that for filtering. – Dribbel Feb 21 '10 at 11:24
  • If this is the solution. It will take more time to show the Results.. –  Jun 21 '12 at 13:39