Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8862491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:44:32+00:00 2026-06-14T15:44:32+00:00

I am getting distinct Company Name through this query List<string> listCieId = new List<string>(from

  • 0

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

enter image description here

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:44:35+00:00Added an answer on June 14, 2026 at 3:44 pm

    Try:

    var minDate = lstDatesCtcStartDate.Min();
    

    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:

    class Company
    {
        public string Name { get; set; }
        public DateTime Date { get; set; }
    }
    
    var companies = new List<Company>();
    
    var companiesWithMinDate = companies.GroupBy(c => c.Name).Select(g => new { Name = g.Key, Date = g.Min(c => c.Date) });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query select distinct Name,ID from tbl_abc where Name like '%william jam%'
Getting ORA-00918: column ambiguously defined: running this SQL: SELECT * FROM (SELECT DISTINCT(coaches.id), people.*,
Having trouble getting this syntax right: SELECT DISTINCT id FROM metadata WHERE (meta_key =
I have this query: SELECT DISTINCT(b.friend_id) AS possible_id FROM friends_friends a JOIN friends_friends b
select DISTINCT rtrim(ITEMID) FROM [MIS-028].[AX-DW-QTY].[dbo].ITEMQTYHISTORY_2 where ITEMID = 'S991071215' This record is present in
I am working on getting the results of this sql query in LINQ SELECT
Getting this weird LINQ error. title = System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String Here is the code I have:
I'm getting this error when using LINQ2SQL: The query contains references to items defined
i have this query in my code I am getting this Error. var auditMandate
im getting an exception on this: Dim strings_extreme As String() strings_extreme(0) = it says

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.