I am trying to convert this SQL to linq syntax, but I m having some difficulties at that.
SELECT trans_date, count(*) FROM table1
GROUP BY trans_date
Result
01-01-2001 | 12
03-01-2001 | 45
var q = from a in table1
let dt = q.trans_date.value
group q by new {y = dt.Year.ToString(), m = dt.Month.ToString(), d = dt.Day.toString()}
into g
select new { int NumOf = g.Count(), DateTime TransDate = DateTime.Parse(g.Key.y + g.key.m + g.Key.d)}
最后一次“改写”的日期。 Parse给我留下了一个错误。
如何处理这一术语——日期是不可否认的日期和取得我的成果?