Wednesday, April 13, 2011

Filtering a List by Greater Than or Equal to Date:SharePoint Date Filter

I wanted to do was display a SharePoint list on the screen and add a filter to the screen that would allow a user to filter the list with a date field value greater than or equal to whatever a user entered.  Should be easy? Well, I dropped my SharePoint list on a page, dropped a Date Filter on the page (this is an Enterprise feature by the way), connected the filter to the list and… I simply could not find a way to make the filter work as anything but a “Date equal to” filter.  That’s not really very useful for most real world applications right?
 I was able to fairly easily come up with a functional solution using SharePoint Designer.
 Following the steps below you can export the web part created in SharePoint Designer and drop that web part on another page.

the steps we will take are as follows:
  1. Convert List View to XSLT Data View
  2. Create a Parameter for the Data View
  3. Filter the Data View Using the Parameter
  4. Drop Date Filter Web Part on Page
  5. Connect Parameter on Data View to Date Filter

Convert List View to XSLT Data View

First thing we need to do is get our Issues list on a page and convert it to an XSLT Data View.  Doing this gives a lot of functionality we need in SharePoint including:
  • The ability to export/import the web part
  • The ability to manually modify the XSLT for the web part
  • The ability to create and modify parameters for the web part
So, let’s get started.  Create a blank Web Part Page in SharePoint and open up that page in SharePoint Designer.

Click on “Click to insert a Web Part” which will bring up the web part list in the right side panel if it is not already there.  Find your list in question (Issues List in my case) and drag and drop it into the page.

Follow the link:
Drop Issues on Webpart Page

Now, right click on the List and select “Convert to XSLT Data View”.

Visually you won’t see a huge change, but you now have access to the “Common Data View Tasks” menu which is what we need.

Create a Parameter for the Data View

Next we want to create a new Parameter for the Web Part.  This parameter will eventually hold the value of our Date that we will use to filter the list on.
From the “Common Data View Tasks” menu, click on “Parameters”.

Click on “New Parameter”.  Give it a name (“DueDate” in this example).  Specify the Parameter Source as “Form” (not sure how necessary this is, but it’s what I did when it worked).  ‘Form Field’ and ‘Default Value’ are not needed.  When you are done you should have a parameter that looks like the following.

Click “OK”.  You now have a “DueDate” Parameter created.

Filter the Data View Using the Parameter

Even though our “DueDate” Parameter does not have a value yet and is not connected to a field, we still want to set up our Web Part to be filtered on this Parameter.  The Filter is set up as follows:
From the “Common Data View Tasks” Menu select “Filter:”

Click on “Click here to add a new clause”.  In this new clause specify the Field Name as “Due Date”, the Comparison should be “Greater Than or Equal”, and the Value should be the parameter we just created “[DueDate]”.  When you are finished your filter will look something like:

Click on “OK” and then save your page.  We are done with SharePoint Designer.

Drop Date Filter Web Part on Page

It’s time to open up your page in SharePoint. When you do, you will notice you see nothing but an empty list.  That’s because our filter is being used with our parameter and it does not have a value for “DueDate” yet.  Don’t panic. 
Open up the page in Edit mode by clicking on “Site Actions->Edit Page.

in edit mode, click on “Add a Web Part”.  Select “Date Filter” from the Filters section and click on “Add”.  Again, this is an Enterprise only feature.

Your page now looks something like this:

Go ahead and click “Open the tool pane” or “edit->Modify Shared Web Part” for your Date Filter and give the filter a name of “Due Date Greater Than or Equal To:”

Now click on “Apply”. 

Connect Parameter on Data View to Date Filter

We are now ready to connect the Date Filter to the Issues Web Part so that everything works.
From the Issues Web Part click on “edit->Connections->Get Parameters From->Filter: Due Date Greater Than or Equal To:”

Select “DueDate” from the window that pops up and click on “Finish”.

That’s it! Now click on “Exit Edit Mode” and let’s see if it works.

Testing it out

Enter a date in the Date Filter or click on the Calendar icon and select a date.  Your list should now appear showing all the entries with due dates greater than or equal to the value in the Date Filter.


That’s all there is to it.  Not too hairy I hope?  You can play with this in SPD or play with the XSLT directly and customize this even more, but that’s for another blog post.
Hope you guys learned something! Thanks again for stopping by.


I was able to get this to work with a date between "Start Date" and "End Date". (Just verified to be sure).
To do this, follow all the steps in this blog and then:
  1. In SPD, Create another parameter for the list web part for "Date less than or equal to" (I called it "ToDate")
  2. Add an additional filter to the list web part so that the filter is: "due date" is greater than or equal to "DueDate" and "due date" less than or equal to "ToDate"
  3. Drop another Date Filter Web Part on the page
  4. Connect the new date filter to the parameter "ToDate" on your list web part. Using the list web part’s "connections->get parameters from.


  1. Hi,
    That work in SP2010 to (no need to convert in XSLT view).
    But i have a big trouble : after applying this parameter filter, there is no way to use standard filters via columns header anymore.
    Did you know why, and what can i do ?

  2. Hello there! I know this is kind of off topic but I was wondering
    which blog platform are you using for this site?
    I'm getting sick and tired of Wordpress because I've had
    issues with hackers and I'm looking at alternatives for another platform. I would be fantastic if you could point me in the direction of a good platform.

    My weblog Http://Refrigeratorwaterfilters.Webs.Com/Apps/Blog/Show/20856358-Frigidaire-Refrigerator-Water-Filters-Finding-The-Best-Ones

  3. You really make it seem so easy with your presentation but I find this topic to be actually something which I think I would never understand.
    It seems too complicated and extremely broad for me.
    I'm looking forward for your next post, I'll try
    to get the hang of it!

    Also visit my page;

  4. Very descriptive article, I loved that a lot.
    Will there be a part 2?

    Here is my website -

  5. I am genuinely delighted to read this webpage posts
    which carries plenty of valuable data, thanks for providing such data.

    Here is my blog -

  6. Hi there, I wish for to subscribe for this web site to get latest updates, thus
    where can i do it please assist.

    Also visit my blog;

  7. Hello! Quick question that's totally off topic. Do you know how to make your site mobile friendly? My weblog looks weird when browsing from my iphone. I'm trying to find a theme or plugin that might be able to fix this problem.

    If you have any suggestions, please share. Cheers!

    My weblog; profollica or provillus

  8. Hello, I enjoy reading all of your article post.
    I wanted to write a little comment to support

    Take a look at my webpage;
    My page: profollica shampoo reviews

  9. I'm not sure where you are getting your info, but good topic. I needs to spend some time learning much more or understanding more. Thanks for magnificent information I was looking for this information for my mission.

    Here is my site: HTTP://

  10. I'm really impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the excellent quality writing, it is rare to see a great blog like this one nowadays.

    Stop by my page;

  11. I feel this is one of the such a lot vital info for me. And i'm happy studying your article. But should remark on few basic issues, The website style is great, the articles is in reality nice : D. Excellent task, cheers

    My page -

  12. Hello, Neat post. There is a problem along with your site in internet explorer, might check this?
    IE still is the market leader and a good component of people will pass over
    your magnificent writing due to this problem.

    Review my web-site: Coloncleanserreviews.typepad.Com

  13. This is my first time visit at here and i am genuinely impressed to read all
    at alone place.

    Feel free to visit my web site:

  14. Hello! I've been reading your site for some time now and finally got the bravery to go ahead and give you a shout out from Houston Tx! Just wanted to tell you keep up the fantastic work!

    Feel free to surf to my web blog -

  15. I am sure this article has touched all the internet viewers,
    its really really good article on building up new blog.

    My web site - Barry

  16. Hi great blog! Does running a blog similar to this take a large amount
    of work? I've very little understanding of computer programming however I had been hoping to start my own blog in the near future. Anyway, if you have any suggestions or techniques for new blog owners please share. I know this is off subject however I simply needed to ask. Appreciate it!

    My page:

  17. Simply want to say your article is as astonishing.
    The clarity in your post is simply great and i can assume you are
    an expert on this subject. Fine with your permission let me
    to grab your RSS feed to keep up to date with forthcoming post.
    Thanks a million and please carry on the rewarding work.

    Check out my page ... provillus in qatar

  18. When someone writes an article he/she maintains the image of a user in his/her brain that how a user can be aware of it.
    Therefore that's why this article is outstdanding. Thanks!

    Feel free to surf to my blog post:

  19. Hurrah! After all I got a website from where I be able to in fact obtain helpful
    information concerning my study and knowledge.

    Look into my site ... provillus users

  20. hey there and thank you for your information – I've definitely picked up something new from right here. I did however expertise some technical issues using this site, as I experienced to reload the site many times previous to I could get it to load properly. I had been wondering if your web host is OK? Not that I'm complaining, but sluggish loading instances times
    will often affect your placement in google and can damage your quality score if advertising and marketing with Adwords.
    Well I am adding this RSS to my e-mail and can look out for a lot more of your respective exciting content.

    Ensure that you update this again soon.

    my weblog -

  21. What's up colleagues, its fantastic article regarding educationand completely explained, keep it up all the time.

    Feel free to visit my webpage ...

  22. I visited multiple websites however the audio feature for audio songs present at this web site is really excellent.

    My weblog;

  23. This is my first time go to see at here and i am actually pleassant to read all at single place.

    Feel free to surf to my web-site -

  24. It's going to be end of mine day, but before finish I am reading this fantastic piece of writing to increase my experience.

    Here is my homepage

  25. Тhe Aubergе Rіpplecоve аnd
    tantгa vary ԁepеnԁing on tіmе of
    departure. Іf уou neеd to relax,
    as yοu gain businеss whilе thе cοmpany
    offeгіng the incentiveѕ gains motivatеd, hapρy emplοyeеѕ.

    Ϻy blog; head massage

  26. Its such as you read my mind! You appear to grasp so much approximately this, such as you wrote the e-book in it or something.

    I believe that you simply can do with a few p.c. to pressure the message house a bit, however
    instead of that, that is excellent blog. An excellent
    read. I'll definitely be back.

    My web blog :: jackpot 6000

  27. I am regular visitor, how are you everybody? This paragraph posted at this site
    is genuinely nice.

    my web-site Jackpot 6000 Free

  28. No matter if some one searches for his required thing, therefore he/she wishes
    to be available that in detail, thus that thing
    is maintained over here.

    Here is my site ... jackpot 6000 - -

  29. Superb blog! Do you have any recommendations for aspirіng writers?
    Ι'm planning to start my own blog soon but I'm a little lοst on everything.

    Would you advise starting wіth a fгee platform like Wordpгeѕs οr go for a paid optiοn?
    Тhere are so many choісes out thеrе that Ι'm completely overwhelmed .. Any recommendations? Bless you!

    Also visit my page: nummerupplysningen

  30. Hoωdy aгe usіng Worԁpress for уοur blog platform?
    І'm new to the blog world but I'm trуing to get started and create my οwn.
    Do you requiгe any сoԁing knowledge to make
    your oωn blog? Any help would be gгеatlу apprеciated!

    Also visit my homepagе - Free Phone Number Search

  31. Having this problem in a SharePoint 2007 environment, but I've never seen this issue come up before: I can filteron equals [Today], but not greater than or less than. This might be an acceptable work-a-round, but there is sopmethign fundementally wrong with both of our SharePoint environments if we can't filter using > or <. You found a band-aid approach to fix it, but you didn't get to the root of the problem.

  32. Nice article, but it's completely plagiarized from SharePoint MVP Mark Rackley. If you're going to copy & paste from others, the least you can do is give them credit.