This project has moved and is read-only. For the latest updates, please go here.

Search values from a list using wild card character

Nov 19, 2012 at 9:21 PM


I am tying to use SPServices very newly. Here I found out how to get the data from a list. But can i use wild card character like * here? In my below code I have used a full title JOHN, but if I want to search all entries srating from H how to do that. Also How can I search between 2 dates? 

var fieldsToRead =  "<ViewFields>" +
                               "<FieldRef Name='Title' />" +
                               "<FieldRef Name='Name' />" +

var query = "<Query>" +
            "<Where>" + 
          "<Neq>" +
            "<FieldRef Name='Title'/><Value Type='Text'>JOHN</Value>" +
             "</Neq>" +
            "</Where>" +
            "<OrderBy>" +
             "<FieldRef Name='Title'/>" +
            "</OrderBy>" +

function GetListDetails() {
operation: "GetListItems",    
async: false,    
listName: "List1",
CAMLViewFields: fieldsToRead,
CAMLQuery: query,
completefunc: function (xData, Status) {});

Nov 19, 2012 at 9:50 PM

No, you can't use wildcard characters in CAML. Again, back to the documentation, this time for CAML so that you can see the options available to you for the CAMLQuery.