I am getting distinct Company Name through this query
List<string> listCieId = new List<string>(from l in LstAdvancePaymentRep select l.CieDesc.Trim()).Distinct().ToList();
What i want to do is get the Minimum Dated Maximum Date for all the companies in listCieId
List<DateTime> listCieId2 = new List<DateTime>(from l in LstAdvancePaymentRep where l.CieDesc.Trim().Distinct() select l.CtcDtStart.Value).Min().ToList();
List<DateTime> listCieId3 = new List<DateTime>(from l in LstAdvancePaymentRep where l.CieDesc.Trim().Distinct select l.CtcDtEnd.Value).Max().ToList();
I am new to such queries haven’t used them before
EDIT: I am using Distinct to get a the distinct company names as there is a repetition in the LstAdvancePaymentRep

EDIT: Tried this out
List<DateTime> lstDatesCtcStartDate = new List<DateTime>(
from l in LstAdvancePaymentRep where l.CieDesc.Trim().Equals(lblCieName.Text.Trim()) select l.CtcDtStart.Value.Date
);
How do i find the minimum date in the LIST lstDatesCtcStartDate
Try:
Or, if your company object had a Name and a Date property and there where multiple of each company and you wanted a list of each distinct company with the smallest date then: