Skip to main content
removed inappropriate use of the `help` tag
Link
willman
  • 3.7k
  • 1
  • 14
  • 25
deleted 204 characters in body
Source Link
Arsalan Adam Khatri
  • 14.5k
  • 3
  • 37
  • 59
 camlQuery.set_viewXml("<View><Query><OrderBy><FieldRef Name='StartDate'  Ascending='False'/></OrderBy><GroupBy>" + 
                                        "<FieldRef Name='SortOrder'/></GroupBy>" +
                                        "<Where>" +
                                        "<Eq>" +
                                        "<FieldRef Name='DisplayGroup' />" + 
                                        "<Value Type='Text'>Home</Value> " +
                                        "</Eq>" +
                                        "<And>" +
                                        "<Leq>" +
                                        "<FieldRef Name='StartDate' />" +
                                        "<Value Type='DateTime'>" +
                                        "<Today />" +
                                        "</Value>" +
                                        "</Leq>" +
                                        "</And>" +
                                        "</Where>" +
                                        "</Query>" +
                                        "</View>");
 camlQuery.set_viewXml("<View><Query><OrderBy><FieldRef Name='StartDate'  Ascending='False'/></OrderBy><GroupBy>" + 
                                        "<FieldRef Name='SortOrder'/></GroupBy>" +
                                        "<Where>" +
                                        "<Eq>" +
                                        "<FieldRef Name='DisplayGroup' />" + 
                                        "<Value Type='Text'>Home</Value> " +
                                        "</Eq>" +
                                        "<And>" +
                                        "<Leq>" +
                                        "<FieldRef Name='StartDate' />" +
                                        "<Value Type='DateTime'>" +
                                        "<Today />" +
                                        "</Value>" +
                                        "</Leq>" +
                                        "</And>" +
                                        "</Where>" +
                                        "</Query>" +
                                        "</View>");
 camlQuery.set_viewXml("<View><Query><OrderBy><FieldRef Name='StartDate'  Ascending='False'/></OrderBy><GroupBy>" + 
 "<FieldRef Name='SortOrder'/></GroupBy>" +
 "<Where>" +
 "<Eq>" +
 "<FieldRef Name='DisplayGroup' />" + 
 "<Value Type='Text'>Home</Value> " +
 "</Eq>" +
 "<And>" +
 "<Leq>" +
 "<FieldRef Name='StartDate' />" +
 "<Value Type='DateTime'>" +
 "<Today />" +
 "</Value>" +
 "</Leq>" +
 "</And>" +
 "</Where>" +
 "</Query>" +
 "</View>");
Source Link

CAML Query and statement not working

I've been working on this query for a while now and I can't get it to return any rows. It was working before I added in the content between and added the and statement.

 camlQuery.set_viewXml("<View><Query><OrderBy><FieldRef Name='StartDate'  Ascending='False'/></OrderBy><GroupBy>" + 
                                        "<FieldRef Name='SortOrder'/></GroupBy>" +
                                        "<Where>" +
                                        "<Eq>" +
                                        "<FieldRef Name='DisplayGroup' />" + 
                                        "<Value Type='Text'>Home</Value> " +
                                        "</Eq>" +
                                        "<And>" +
                                        "<Leq>" +
                                        "<FieldRef Name='StartDate' />" +
                                        "<Value Type='DateTime'>" +
                                        "<Today />" +
                                        "</Value>" +
                                        "</Leq>" +
                                        "</And>" +
                                        "</Where>" +
                                        "</Query>" +
                                        "</View>");

Thanks in advance for any help.