私は次のようなデータテーブルを持っています
Date status recno
---------------------------------
2012 DST;Par 1
------------------------------------
2012 DST 2
--------------------------------
2012 DST 3
--------------------------------------------
2012 DST;Ts 4
-----------------------------------
現在、次のようなクエリを作成しました。
var data = from b in table.AsEnumerable()
where b.DateInterval>=fromDate && b.DateInterval<=toDate
group b by b.Channel1_status into g
select new
{
AccountNo=accountNumber,
Status = statusLabels[g.Key].ToString(),
StatusCount = g.Count(),
};
ただし、次の結果が返されます。
Result: DST-2
DST;par-1 and DST;Ts-1
Expected: DST-4 DST;par-1 and DST;Ts-1
私が間違っていることと、期待される結果を得る方法を教えてください。