Forum Discussion
Content Query Web Part and Dates
Also to get the this week done:
- Waldek MastykarzAug 19, 2016Copper Contributor
One way to go around it would be to define a query that would get items from previous 7 days to next 7 days: that way you would be safe on Sunday (getting items from the past week) as well as on Monday (getting items from the upcoming week). You could then sort items ascending by the date and do filtering in XSLT. The https://msdn.microsoft.com/en-us/library/dd583143(v=office.11).aspx contains some date manipulation functions that could help you with that. It's not trivial but it's definitely doable. It's worth noting that this approach would work if the list of items is not huge and retrieving items from -7 days to + 7 days wouldn't return hundreds of items.
Hope this helps,
Waldek
- Aug 19, 2016So if you create a start of the week calculated column you can filter by
Date > start of week and date <= today - AnonymousAug 18, 2016
Would definitly go for search and displaytemplates it is much faster than CQWP you need to invest some time in it but it makes your users happy.
kr,
Paul
- Waldek MastykarzAug 19, 2016Copper Contributor
The performance really depends on the size of the list and the scope of the query. Also with search you have to take into account the index latency which, depending on your search configuration, might be causing not all items being returned.