troubleshooting Question

SharePoint and CAML query help

Avatar of Isaac
IsaacFlag for United States of America asked on
Microsoft SharePointJavaScript
4 Comments1 Solution254 ViewsLast Modified:
I have created a caml query that filters based on fiscal year (2016,2017,2 etc.).  The problem that I have is the results are wrong sometimes.
Below is my CAML query
 var prjQry = "<View>"+
	    			"<Query>"+
						"<Where>"+
							"<Or>"+
							  "<Eq>"+
							  	"<FieldRef Name='Design_x0020_Obligation_x0020_Da' />"+
							  		"<Value Type='Text'>"+vaFY+"</Value>"+
							  "</Eq>"+
							  "<Eq>"+
							  	"<FieldRef Name='Construction_x0020_Obligation_x0' />"+
							  		"<Value Type='Text'>"+vaFY+"</Value>"+
							  "</Eq>"+
							"</Or>"+
						"</Where>"+
		    			 "<OrderBy>"+
		    			 	"<FieldRef Name='Prioritization_x0020_Total' Ascending='True' />"+
		    			 "</OrderBy>"+
	    			 "</Query>"+
	    		"</View>";

here's the result when filtered by '2017' which is correct:
caml query filter 1
here's the result when filtered by '2018' which is wrong.  I have no idea why data is being returned.
caml query 2
here's the result when filtered by '2020' which is correct:
caml qry 3
Any idea why the inconsistent behavior?

Thanks!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros