I've a custom list called Events which pulls back all events that are created within a calendar and I'm grouping the events by a column called Month. I'm then sorting them by the month of the Start Time.

My problem however is that I'd like to have the grouping of months be sorted so that; for e.g. when an item is created in December 2009 and another is created in January 2010 it flows correctly. It shouldn't show an event in July 2009 after Jan 2010, it should be the other way around July 2009 then Jan 2010.


A calculated column is probably the simplest approach, though I would tend to go with the Data View Web Part (DVWP) for the longer term flexibility. What you want to do is sort by the Year/Month in a format like this: 200111 200912 201001 201002 etc.

The calculated column would be something like this:

=YEAR([Start Time])&MONTH([Start Time])

and the variable in the DVWP would be this:

<xsl:variable name="StartDateYYYYMM" select="ddwrt:FormatDateTime(string(@EventDate), 1033, ‘yyyyMMdd’)”>



The easiest way would be to create another column (in numeric format) and then sort everything by it. OOTB view will probably be limiting so I would advise create a custom view with SharePoint Designer and Data View Web Part. Check posts by Laura Rogers for more details on Data View Web Part.


How about a creating a calculated column and sort it using the calculated column?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy