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

  • Home
  • SEARCH
  • 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 977209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:52:04+00:00 2026-05-16T03:52:04+00:00

I use linq2sql and m_DateContext.Dates class for table ID | ParentID | Datestamp —|———-|———-

  • 0

I use linq2sql and m_DateContext.Dates class for table

ID | ParentID | Datestamp
---|----------|----------
1  | NULL     | 1.8.2010
---|----------|----------
2  | 1        | 2.8.2010
---|----------|----------
3  | 1        | 4.8.2010

etc…

I need to write the linq query to select only rows where ParentID is NULL (ex: ID=1), BUT Value of DATESTAMP must be equals to max date from it’s child rows. (Row ID=3).

Linq query must return an instance of m_DateContext.Dates with non-broken links to entities in database schema.

Result must be smthng like:

ID = 1 ParentID=NULL Datestamp = 4.8.2010

Please help

  • 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-05-16T03:52:04+00:00Added an answer on May 16, 2026 at 3:52 am

    All kinds of assumptions (linq to entities or sql) and I think you want a let…

    var query = (
         from i in TDates
            where i.ParentID==null
         let maxDate= TDates.Max(d=>d.Datestamp) 
         select new {
           NonBrokenRecord = i,
           Datestamp = maxDate
         }
    
    ).ToList();
    

    Once you get the results you could do…

    query.ForEach(x=>x.NonBrokenRecord.DateStamp = x.Datestamp);
    query = query.Select(x=>x.NonBrokenRecord).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 511k
  • Answers 511k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you sure the alert works fine? It should not… May 16, 2026 at 5:17 pm
  • Editorial Team
    Editorial Team added an answer As far as I can see in the docs, using… May 16, 2026 at 5:17 pm
  • Editorial Team
    Editorial Team added an answer As a rule of thumb, pulling all the information you… May 16, 2026 at 5:17 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

USE [Fk_Test2] GO /****** Object: Table [dbo].[Owners] Script Date: 08/20/2010 16:52:44 ******/ SET ANSI_NULLS
Is it possible to use LINQ2SQL as MVC model and bind? - Since L2S
I have started using Linq to SQL in a (bit DDD like) system which
I've a problem with saving changes to database, I'm using LINQ2SQL mapping. I've implemented
Normally when you update an object in linq2sql you get the object from a
what is the preferred practice when linq2sql using (in asp.net mvc applications): to create
So I'm starting to use Ninject for dependency injection and I'm wondering what people
I've used Linq2SQL lots and am familiar with most of the concepts (up to
I have a GridView using LinqDataSource to populate data from table Tickets . The
use case: 5 - 30 users simultaniously on a chat. is it a good

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.