title: Get the List of max and min dates from a LIST
body: <p>I am getting distinct Company Name through this query </p>
  
  <pre><code> List&lt;string&gt; listCieId = new List&lt;string&gt;(from l in LstAdvancePaymentRep select l.CieDesc.Trim()).Distinct().ToList();
  </code></pre>
  
  <p>What i want to do is get the Minimum Dated Maximum Date for all the companies in <code>listCieId</code> </p>
  
  <pre><code>   List&lt;DateTime&gt; listCieId2 = new List&lt;DateTime&gt;(from l in LstAdvancePaymentRep where l.CieDesc.Trim().Distinct() select l.CtcDtStart.Value).Min().ToList();
  
  List&lt;DateTime&gt; listCieId3 = new List&lt;DateTime&gt;(from l in LstAdvancePaymentRep where l.CieDesc.Trim().Distinct select l.CtcDtEnd.Value).Max().ToList();
  </code></pre>
  
  <p>I am new to such queries haven't used them before</p>
  
  <p><strong>EDIT:</strong> I am using Distinct to get a the distinct company names as there is a repetition in the LstAdvancePaymentRep</p>
  
  <p><img src="https://i.stack.imgur.com/jz1Em.png" alt="enter image description here"></p>
  
  <p><strong>EDIT:</strong> Tried this out </p>
  
  <pre><code> List&lt;DateTime&gt; lstDatesCtcStartDate = new List&lt;DateTime&gt;(
   from l in LstAdvancePaymentRep where l.CieDesc.Trim().Equals(lblCieName.Text.Trim()) select l.CtcDtStart.Value.Date
   );
  </code></pre>
  
  <p>How do i find the minimum date in the LIST lstDatesCtcStartDate </p>