I want to build a CAML query to search for all title fields that do NOT begin with a certain value:
something like this: Where Title NOT BeginsWith 'myvalue'.
How can i do that in my CAML query?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
You might try adding a calculated column on your list, something to the effect of:
=IF(LEFT([Title], 7)="myvalue", "YES", "NO")
Then you could use the CAML query to check the calculated column for "YES" or "NO".
You might have to adjust the formula above to account for NULL or to test if the overall length (LEN) of the string is longer than the prefix you are checking for, but hopefully you get the idea.
Here is the resource for the forumlas you can use in the calculated column:
You can download the U2U Caml Query application. It is usefull and help you to make caml query easily.