Archive

Posts Tagged ‘Date range’

Date Range in a Content Query Web Part

April 18th, 2011 Abed Khooli 2 comments
CQWP - date range

Content Query Web Parts (CQWP) are very powerful in aggregating site content (not limited to current site, but can span the whole site collection). They provide several customization, presentation and filtering options. They also support target audiences at the item level and can be limited to certain content types. However, date filters are not easy to configure if a date range is required (for example, the latest announcements – those in the past couple weeks).
Luckily, there is a help icon next to the Additional Filters section and it has some hints on how to set a date offset. In the illustration here, the CQWP fetches the announcements that are less than 7 weeks old (nothing special about the number 48 except it works with the test list which had few entries and most were more than 7 weeks old). Notice the -48 notation (no space) which means [Today] + [-48] days.
You can find more about advanced customization of the Content Query Web Part at: http://msdn.microsoft.com/en-us/library/aa981241.aspx