views:

9

answers:

0

I have a table named Rent that holds information about rent activities in a video library. I need to write a report that display rent activity per month from a given date. So far I have this query:

from rent in hitechBuster.Rents
where (rent.RentStart <= refDate &&
       (rent.RentEnd == null ||
        rent.RentEnd >= refDate)) ||
       rent.RentStart > refDate
group rent by new { m = rent.RentStart.Month, 
                    y = rent.RentStart.Year } into actGroup
select new RentActivity
      {
       RentCount = actGroup.Count(),
       ActivityMonth = actGroup.Key.m,
       ActivityYear = actGroup.Key.y
      }

My question is, is it possible to add the monthes that have no activity in them to the query as well?

Thanks, Guy