I have a Content Query Web Part looking at a SharePoint list which contains a column called "Year". Is it possible to add a filter within the web part properties that will only display items of the current year?

For example, if I enter a list item with a year column of 2014, it won't display. However, when we turn to 2014, the CQWP automatically registers the current year and displays items with 2014 in the year column.


I don't think it is possible to do it OOB by using webpart properties. However, you can create a CAML query which does exactly that and then use the QueryOverride property of CQWP.


You could very easily achieve filtering capabilities with Data View Web Part and any of the Filter Web parts (e.g. List based filter WP).

You should use of course SharePoint Designer to add a new Web part, pointing to your list and choosing data you want. Then using the "Filter" and "Parameters" ribbon buttons, you could define the filter on the Year column where value is taken from - choose Parameters - Add New and define a simple parameter (empty, not taking values from anywhere).

Using the Web Part connections framework you could link the 2 and send Values from filter to your DVWP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.