Leon Meijer's Weblog

About my personal life, technology and business/work related...
posts - 129, comments - 334, trackbacks - 0

How to only display "This Week" items in a SharePoint List

I have a SharePoint list and would like to create a view that shows me all the items that are modified in this week. SharePoint views can be filtered, so I thought this wouldn't be a big deal. Unfortunatly.

I had the idea to create a filter related to [Week]. But the SPS/WSS filter criteria cannot accept [Month] or [Week], only [Today] and [Me] on the creating new view's filter section.

This post is based on SPS 2003/WSS 2.0. I don't know if its applicable to MOSS/WSS 3.0.

This is how to create the filter (based on this article):

  1. Go to the List;
  2. Select 'Modify Settings and Columns';
  3. Select 'Create a new view ';
  4. Select 'Standard View' ;
  5. Give the view a name;
  6. In the filter section, select 'Modifed' and select 'Equal' and type '[Today]';
  7. Save the new view;
  8. Open FrontPage 2003;
  9. Open the webpage containing the list, for example:
    http://localhost/testapp/Lists/My Issues/Closed%20Last%20Month.aspx
  10. Switch to the code view;
  11. Locate below:
    <Where><Eq><FieldRef Name="Modified"/><Value Type="DateTime"><Today/></Value></Eq></Where>
  12. Replace it with:
    <Where><DateRangesOverlap><FieldRef Name="Modified"/><FieldRef Name="Modified"/><Value Type="DateTime"><Week/></Value></DateRangesOverlap></Where>
  13. Save the changes, its done.

 PS You can also create the filter for a month. In order to do that, replace the bold text 'Week' to 'Month'.

Print | posted on Wednesday, May 09, 2007 11:38 AM | Filed Under [ Technology ]

Powered by: