How to filter items by creation date

…this post was published on 2014 June 24.

Starting from this post, let’s try to reproduce the request and solve the problem.
First I created a new list, a test list –  a minimal one. On this list I added 2 fields.

First one, named: “My Date” because i can’t use [Creation Date] ( i can wait a month ). this field is a date type column, only date, as bellow

and the second one a calculated column, “Calc_date

​ The calculated formula for this column is this one:
=YEAR([My Date])&IF(MONTH([My Date])>=9,MONTH([My Date]),”0″&MONTH([My Date]))
I added some values to my list, and the Allitems.aspx page looks like:

So far, so good.
Now , using Sharepoint Designer, let’s create a new asp page, and insert there  a DFWP, with these 3 columns: Title, My date, Calc_Date

 Using Sharepoint Designer’s Ribbon, let’s add some changes

And there select “Show Content” and next add the following formula:

<xsl:if test=”@Calc_date = concat(substring(substring-after(substring-after(string(ddwrt:Today()),’/’),’/’),1,4),substring-before(string(ddwrt:Today()),’/’))”>

This way, the items will be filtered based on current month.

This entry was posted in CalculatedColumn, Sharepoint, Sharepoint Designer. Bookmark the permalink.