score:3

Accepted answer

After reading this (also with more information on this topic):

http://msdn.microsoft.com/en-us/vbasic/bb738024.aspx

I come up with:

Dim Items = From Item In DB.Items _
  Group Item By CatID = Item.CatID Into Group Select CatID, _
  YearGroups = From y In Group _
    Group y By YearKey = y.PubDate.Value.Year Into YearGroup = Group _
    Select Year = YearKey, _
    MonthGroups = From m In YearGroup _
      Group m By MonthKey = m.PubDate.Value.Month Into MonthGroup = Group _
      Select Month = MonthKey, MonthItems = MonthGroup

Related Articles