日期:2014-05-20 浏览次数:20821 次
from a in DB group a by
new
{
Date = a.OperDate.Date
//或Date = EntityFunctions.CreateDateTime(a.OperDate.Year,...)
}
var list=DB.Select(t => { return new { OperDate = t.OperDate.ToString("yyyy-MM-dd") }; }).ToList();
list = list.GroupBy(g=>g.OperDate).Select(t => { return new { OperDate = t.Key, count = t.Count() }; });
from a in DB
group a by EntityFunctions.TruncateTime(a.OperDate) into g
select g.Key