Print Version Email Page Add to Favorites Comments Alert Me Add to My Links

Friday, April 11, 2008

SharePoint : Make a list view that shows only items dated 'This Week'

1. Create a datetime column named Date.

2. Create a calculated column named WeekStart returning type datetime, with the calculation:
=IF(TEXT(WEEKDAY(Date),"ddd")="Mon",Date,IF(TEXT(WEEKDAY(Date-1),"ddd")="Mon ",Date-1,IF(TEXT(WEEKDAY(Date-2),"ddd")="Mon",Date-2,IF(TEXT(WEEKDAY(Date-3) ,"ddd")="Mon",Date-3,IF(TEXT(WEEKDAY(Date-4),"ddd")="Mon",Date-4,IF(TEXT(WEE KDAY(Date-5),"ddd")="Mon",Date-5,Date-6))))))

3. Create a calculated column named WeekEnd returning type datetime, with the calculation:
=IF(TEXT(WEEKDAY(Date),"ddd")="Sun",Date,IF(TEXT(WEEKDAY(Date+1),"ddd")="Sun ",Date+1,IF(TEXT(WEEKDAY(Date+2),"ddd")="Sun",Date+2,IF(TEXT(WEEKDAY(Date+3) ,"ddd")="Sun",Date+3,IF(TEXT(WEEKDAY(Date+4),"ddd")="Sun",Date+4,IF(TEXT(WEE KDAY(Date+5),"ddd")="Sun",Date+5,Date+6))))))

4. Create a view with the following filter:
WeekStart <= [Today] AND WeekEnd >= [Today]

No comments:

World Clock