.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Filter List Using Date Range of a Column in SharePoint

Posted By:abhays       Posted Date: April 30, 2014    Points: 200    Category: SharePoint    URL: http://www.dotnetspark.com  

In this article, I have explains how to Filter List Using Date Range of a Column in SharePoint

This article explains how to filter a List in the range of data of a date column. It can be done by setting up multiple date filters to filter a list by a date range out of the box in SharePoint 2010 using SharePoint Designer.

We can implement it by using date filter Web Parts to send values to a lists parameters.

For implementing a date range filter, I have created a simple list with a date column.

Use the following procedure to create a sample do this.

Step 1: Open the page in Edit mode and add a Date Filter Web Part.

Step 2: Add two date filter Web Parts, one for the "from" date and the other for the "to" date on the page as below.

Step 3: Open the List View Page in Designer.

Step 4: After opening the List Web Part in SharePoint Designer, click anywhere on the List Web Part to select it, then in the ribbon click on the list view tools select "Options" then the Parameters icon.

Step 5: Add two parameters, "FromDate" and "Todate". Don't make any change in the Parameter Source and Default Value control.

Step 6: Right-click on the From Date filter and click "Add Connection" as below.

Step 7: In the next dialog that pops up change the dropdown value to "Send filter values to" as below and click "Next". 

Step 8: 
Make sure that "Connect to a Web Part on this page" (the default selection) is selected in the next dialog and click "Next".

Step 9: In the next dialog select Target Web Part (if multiple Web Parts are added to the page) and change the target action to "Get parameters from" and click "Next".

Step 10: In the next dialog, select "From Date" from the first box, and "FromDate" from the second box and click "Next". Then click "Finish".

Step 11: Go through the same steps with the second date filter, To Date, and in the final step select "To Date" and "ToDate" from the boxes.

Step 12: Click anywhere on the List Web Part, then in the ribbon click on the List View tools then select "Options" -> "Filters" icon.

Step 13: The filter criteria box will popup. First add a rule "DateOfBirth -> Greater than or equal to -> [FromDate]".

Step 14: Then add another criteria for "ToDate DateOfBirth -> Less than or equal to -> [Todate]". Click "OK".

Step 15: Now save the page and open it back up in your browser.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend