Want to filter list items that were modified on last week
Think pseudocode for this will be Modified >= ( [Today]-WEEKDAY-7 ) && Modified <= ( [Today]-WEEKDAY )
No matter what day of week is today, we need items from previous week:
So as I understand I need to create calculated fields
Previous_Week_StartDate: =[Today]-WEEKDAY-7
and
Previous_Week_EndDate: =[Today]-WEEKDAY
and then filter view like
Modified >= Previous_Week_StartDate and Modified <= Previous_Week_EndDate
But when I use something like '=WEEKDAY([Today])' in calculated column I get errors. Somebody did something like this?
upd.: I can also create View programmatically (with custom CAML query), but don't know how to construct such query
upd.2: Resolved. It was easier: created two calculated fields(return type as Date):
StartWeek, formula:
=Modified-(WEEKDAY(Modified)-1)
EndWeek:
=StartWeek+7
and created filter in views:
So I compare intervals from Sunday to Sunday (think it depends on Your Regional settings)