Group records by someInt
and then make sub-queries to get number of rows for each period of time you are interested in:
DateTime now = DateTime.Now;
DateTime yesterday = now.AddDays(-1);
DateTime weekAgo = now.AddDays(-7);
DateTime monthAgo = now.AddDays(-30); // just assume you need 30 days
DateTime yearAgo = new DateTime(now.Year - 1, now.Month, now.Day);
var query = from a in db.A
group a by a.someInt into g
select new {
someInt = g.Key,
lastDay = g.Count(a => a.someDateTime >= yesterday),
lastWeek = g.Count(a => a.someDateTime >= weekAgo),
lastMonth = g.Count(a => a.someDateTime >= monthAgo),
lastYear = g.Count(a => a.someDateTime >= yearAgo),
anyTime = g.Count()
};