Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Ok so i have a custom list called Events which pulls back all events that are created within a calendar and i am grouping the events by a column called Month. I am then sorting them by the month of the Start Time. My problem however is that i would like to have the grouping of months be sorted so that; for eg. 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

3 Answers 3

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

M.

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

 
discard

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