Share via


How to see items added to a SharePoint list/library in the last X days?

This post will describe how to create a view of a SharePoint list or library which displays the items/documents that have been added to a list or library in the last X number of days (X is a variable you define).

Scenario

A 'Recent Requests' view is needed on a 'Customer Suggestions' document library to allow the head of the complaints department to see the requests customers have submitted in the last seven days. To do this:

1. Create the library/ list

2. Click Create Column on the Settings menu of the library/list

 

 

 

 

 

 

 

 

3. Enter Date Expire as the Column name

 

 

 

 

4. In the Name and Type section, click the Calculated radio button

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5.

 

 

 

 5. In the Additional Column Settings section, in the Formula box, type [Created] + 7

 

 

 

 

 

 

6. In the Additional Column Settings section, click Date and Time

 

 

 

 

 

 

 

 

 

 

7. Click OK

 

8. Click Create View on the Settings menu of the list/library

 

 

 

 

 

 

 

 

 

9. Under Start from an existing view, click All items or All Documents

 

 

 

 

 

10. Enter Recent Requests as the View name

 

 

 

 

11. Check the Make this the default view checkbox

 

 

 

 

12. In the Columns section, uncheck the Date Expire checkbox

 

 

 

 

 

13. In the Filter section, click the Show items only when the following is true radio button

 

 

 

 

14. In the first drop-down, select Date Expire

 

 

 

 

 

15. In the second drop-down, select is greater than

 

 

 

16. In the text-box, type [Today]

 

 

 

17. Click the And radio button

18. Under When column, in the first drop-down, select Date Expire

 

 

 

 

 

19. Under When column, in the second drop-down, select is less than or equal to

 

 

 

20. In the text-box, type [Today]+7

 

 

 

21. Click OK

 

In my next post, I will explain how to create a View of a SharePoint list or library which displays the items/documents that meet a custom date value.

Comments

  • Anonymous
    January 01, 2003
    Good suggestion Mat, I haven't tested your suggestion but the theory seems great. Good thinking....

  • Anonymous
    July 02, 2008
    It is not necessary to create a new column to achieve this as far as I can tell. Simply set the filter settings of the view to show only items where the created or modified (depending on your preference) is greater than or equal to [Today]-x (where x is the number of days you want to display). I've tried this on WSS 3.0 and it seems to work.

  • Anonymous
    August 05, 2008
    I know the Start Times and End Times don't come up when you are using the calendar. So I used the new calculated column to equal the Start Time, then place it in the where clause. That worked fine.

  • Anonymous
    September 28, 2008
    I have been able to get this solution without the need of creating any new column(s). Just do the calculation in the filter like: [Today]-7. Only care that needs to be taken is to avaid the spaces, otherwise it will not continue.