Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
Brilliant, thanks Nadeem. –  Tron Jan 14 '13 at 8:48
    
Glad I could help. –  Nadeem Yousuf Jan 14 '13 at 10:28
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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