I'm trying to create a table using SPServices to fetch the data, and filter it using CAML Query and a drop down list. I would like to create three conditions:
A. If no item from the list is selected, well nothing happens (This part is working)
B. Select a a Fiscal Year from dropdown_a and Regional Office from dropdown_b. This part is working also, and this is query I'm using:
CamlQuery = "<Query><Where><And><Eq><FieldRef Name='Regional_x0020_Office' /><Value Type='Text'>"+regionalOffice+"</Value></Eq><Eq><FieldRef Name='Fiscal_x0020_Year' /><Value Type='Text'>"+fiscalYear+"</Value></Eq></And></Where></Query>";
C. Now I would like to create a third option where if you select "All" in dropdown_a (Fiscal Year), it would list item from all the year for the office selected in dropdown_b. This is what I have done so far with no luck:
CamlQuery = "<OrderBy><FieldRef Name='Fiscal_x0020_Year' Ascending='TRUE'/></OrderBy><Query><Where><Eq><FieldRef Name='Regional_x0020_Office'><Value Type='Text'>"+regionalOffice+"</FieldRef></Eq></Where></Query>";
For some reason it is not showing my code, this is an screen shot:
Any ideas why this third option is not working? Thanks!
I apologize, but for some reason the code I pasted kept deleting themselves, so I have to add them as images.