Sunday, October 4, 2009

Calculate date fields in SharePoint lists

I wanted a custom view where the news are sorted per Year and Month, and then after modified date descending order. I created a new field called Year and used the following formula to calculate year which is really easy:


Then I wanted to get the name of the month instead of the number so I used this formula (this is the swedish version, use comma instead of semicolon in the english version):

=OM(MÅNAD(Skapad)=1;"Januari";"")&OM(MÅNAD(Skapad)=2;"Februari";"") and so on... You must put an empty "" after or else it will write the word "False" in your view =)

In English:

=IF(MONTH(Created)=1, "January","")

No comments: