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 9142503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:47:52+00:00 2026-06-17T09:47:52+00:00

I have a table in the following format: Type Date Code 1 01/01/13 AA

  • 0

I have a table in the following format:

Type   Date   Code
 1   01/01/13  AA
 1   01/01/13  AB
 1   01/01/13  FV
 1   02/01/13  AE

Using a join against another table, I can bring back the highest date by :-

g.Max(d => f.Field<DateTime>("End Date"))

which returns 02/01/13. What I would like to know is how to return “AE”, ie: the value in the adjacent column.

  • 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-17T09:47:53+00:00Added an answer on June 17, 2026 at 9:47 am

    It you’re using LINQ to Objects (as it appears, having fetched a DataTable), you can use MoreLINQ which has a MaxBy method:

    var code = g.MaxBy(f => f.Field<DateTime>("End Date"))
                .Field<string>("Code");
    

    (Disclaimer: I started MoreLINQ a while ago, although others are now more active than I am.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following date format 28 Aug 2010 17:40:58 +0000 Can anyone suggest
I have following table Id | Status | date ------------------- 1 | Onsite |2007
Imagine I have following table: NAME DATE OTHER_CONTANT 'A' '2012-06-05' 'baz' 'A' '2012-06-04' 'bar'
I have the following code to convert a date (from a database entry) into
I have the following table: SQL> desc recording Name Null? Type -------------------- -------- ------
I have a table with the following format. mysql> describe unit_characteristics; +----------------------+------------------+------+-----+---------+----------------+ | Field
I have a mysql log table of machine in the following format. --------------------------------------------------------------------------------------------------- |
i have a mysql table in the following format ------------------------------------------------------------------------------------------------------------- | event_id | event_type
Please help in structuring following type of data (example)- > i have 1 table
I have a table with about 1.4 billion records, with the following format: mysql>

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.