Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have to pull the data from the custom list by using a CAML query.
I would like to use the "Endswith" option in the CAML query however it seems to be unsupported in sharepoint 2007.
What would be the alternative?

Eg:
Search on Internet
Internet Search
Basic Internet lessons
Urbanization and Internetization

I want to fetch all the items which has a keyword of Internet (except the last one) but not Internetization. Is there any other way to achieve the same without using "Endswith".

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Yes, it's a shame that sharepoint don't have EndsWith. As for answer you can develop a custom web part:

  • Use CAML query to reatrive all that contain 'Internet' via <Contains>
  • Results that were provided will only contain those that have 'Intranet' and you can iterate over each item and check if it ends with Internet String.EndsWith .

The worst case if all words contain Internet then implement paging and get them from list in packs that wont create much impact.

share|improve this answer
    
It's a pity to iterate through all the results, not only you will be waiting for the query to execute, you will also lose time iterating through all the results, what if the query returns tons of rows? –  Zee99 Jun 16 '11 at 14:27
    
Yeah I have a library with 6000 records, yuk. –  Russell Jul 5 '11 at 4:19

Your Answer

 
discard

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.