We help IT Professionals succeed at work.

Filtering a list view by date

Arnold Layne
Arnold Layne asked
on
I have a date field on an infopath form that is exposed via the browser through sharepoint. I want to create an SP list view where I only see items that have a value in it's date field that is less than one month from today's date. Can this be done with a regular list? A web part? Any suggestions?? Thanks.
Comment
Watch Question

Commented:
From what I understand of your question, here is a link to a solution: http://raytechaddons.blogspot.com/2009/05/show-last-month-sharepoint-list-items.html

A variation of this solution is also helpful, as that SharePoint does not allow [today] to be referred to in calculated columns... unfortunately, a bit of script involved but very easy to implement:

http://blog.pathtosharepoint.com/2008/08/25/a-countdown-for-tasks-lists/
Arnold LayneDeveloper

Author

Commented:
That first link is what I'm looking for, but I can't see screen caps 3 and 4 on that link, or i should say, i can't see any place that says "formula", so there is something wrong with the properties of my column.as there is no place to enter a formula

Commented:
you have to create two calculated columns that refer to your original date column. the first link bases the month filter by a certain type of deadline or due date you have in mind. otherwise, i don't think i quite understand your question... could you give a more detailed summary of the column you're working with?
Arnold LayneDeveloper

Author

Commented:
I have timesheets that are infopath forms, and Sharepoint site content types and are stored in a sharepoint library that has that content type. On the form, we have a date field where they select the week the timesheet represents by selecting a starting Monday date from a datepicker. I want to create a view and filter it for the last 30 days, last 90 days, 180 days.....I am also hoping that I can total the job columns only for the time period specified by the view. This way, management knows how much to bill out for a job in any given time frame that he or I will create in the views.

Commented:
There are two ways to go about this:
1. Create views that use [Your date] - 30 AND Today, [Your date] - 90 AND Today, etc.
2. You will need to dip your feet into xslt: http://blogs.msdn.com/b/sharepointdesigner/archive/2008/02/25/filtering-and-formatting-with-date-values.aspx
Check out the post, "Filter to show items within a date range".
Arnold LayneDeveloper

Author

Commented:
Hi miensta, I finally found what I saw on screen caps three and four on the first link you posted in your first response. I needed to make it a calculated column to see the formula text field. So your first post might work, as this was the only problem i was having so far. Give me a little bit to try it and I'll get back to you.. I just didn't want you to think i dropped this question.

Commented:
Sure, no problem. Yeah, unfortunately the formulas are stuck in the screen shots, but it shouldn't be too hard to copy over. :) Let me know how it goes.
Arnold LayneDeveloper

Author

Commented:
Sorry I couldn't get to this for a while, but it works. Thanks.