locked
How to filter a List view with Current Year? RRS feed

  • Question

  • I would like to add a current year filter condition in list view. The list have column "Expiry Date", i want to display all items which expire on  current year.

    How to achieve this functionality.

    Thank You


    • Edited by SP Support Monday, January 21, 2013 3:13 PM
    Monday, January 21, 2013 3:12 PM

Answers

  • You will need to use some workaround shown in the blog below.

    http://sivanesanb.blogspot.ch/2011/11/how-to-use-filters-in-sharepoint-to.html

    1) Create two calculated columns Start Year and End Year

    2) Start Year = DATE(YEAR([Expiry Date]),1,1)

    3) End Year = DATE(YEAR([Expiry Date]),12,31)

    4) Create a View and Filter Condition will be

    Start Year is Less Than or Equal to [TODAY]  AND End Year is Greater Than Equal To [TODAY]




    Amit

    • Marked as answer by SP Support Tuesday, January 22, 2013 2:08 AM
    Monday, January 21, 2013 3:41 PM

All replies

  • You will need to use some workaround shown in the blog below.

    http://sivanesanb.blogspot.ch/2011/11/how-to-use-filters-in-sharepoint-to.html

    1) Create two calculated columns Start Year and End Year

    2) Start Year = DATE(YEAR([Expiry Date]),1,1)

    3) End Year = DATE(YEAR([Expiry Date]),12,31)

    4) Create a View and Filter Condition will be

    Start Year is Less Than or Equal to [TODAY]  AND End Year is Greater Than Equal To [TODAY]




    Amit

    • Marked as answer by SP Support Tuesday, January 22, 2013 2:08 AM
    Monday, January 21, 2013 3:41 PM
  • Excellent!. Thanks Amit
    Tuesday, January 22, 2013 2:09 AM
  • I found this solution very useful, thanks a lot.

    What if you wanted to show items where the year filter condition is either current OR last year?

    Thanks in advance.

    Jonathan

    Monday, January 18, 2016 11:36 PM
  • How, How did this work for you?  When one tries to apply the filter it the list, comparing a calculated date field to 'Today' the system will not accept it.  You get a data mismatch error.  Text vs. Date. 
    Friday, August 24, 2018 12:08 AM