Home
Options

Min / aggregate function

Hiya!
Can anyone please tell me what is wrong with my syntax? using C# in Linq. I need to display the employee with the earliest start date (i.e. min join date). Any assistance would be greatly appreciated. Many thanks.

var firstemp1=
from e in Employees
select new
{
EmpNum = e.EmpNum,
EmpJoinDate = e.EmpJoinDate.Min()
};
firstemp1.Dump();

Sign In or Register to comment.