SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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’)”>


share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.