日期:2014-05-20 浏览次数:20787 次
DateTime dt = DateTime.Parse("2012-11-26");
var list = from a in TableA
where a.EffectiveDate<= dt
group a by a.Number into g
select new
{
Number = g.Key,
EffectiveDate = g.Max(a => a.EffectiveDate)
};
var query=from t in db.TableA
where t.EffectiveDate.CompareTo(Convert.ToDateTime("2012-11-26 00:00:00.000"))
group t by t.Number into g
select new