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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:53:16+00:00 2026-05-28T06:53:16+00:00

I am struggling with how to write the below equivalent as LINQ. Truly I

  • 0

I am struggling with how to write the below equivalent as LINQ. Truly I guess I am only struggling with how I represent the INNER JOIN () portion. Is that called a Nested Join? Anonymous Join? I am not even sure. Anyway, big thanks to anyone who can point me true. Even if it is just what this is called so I can BING it properly.

SELECT p.PersonID, p.FirstName, p.MiddleName, p.LastName, cp.EnrollmentID, cp.EnrollmentDate, cp.DisenrollmentDate
FROM vwPersonInfo AS p
    INNER JOIN (
    SELECT c.ClientID, c.EnrollmentID, c.EnrollmentDate, c.DisenrollmentDate
    FROM tblCMOEnrollment AS c
        LEFT OUTER JOIN tblWorkerHistory AS wh
        ON c.EnrollmentID = wh.EnrollmentID
            INNER JOIN tblStaffExtended AS se
            ON wh.Worker = se.StaffID
    WHERE (wh.EndDate IS NULL OR wh.EndDate >= getdate())
    AND wh.Worker = --WorkerID Param Here
) AS cp
ON p.PersonID = cp.ClientID
ORDER BY p.PersonID
  • 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-28T06:53:17+00:00Added an answer on May 28, 2026 at 6:53 am

    just put the inner query in its own variable. (It will be translated into one single SQL expression)

    var innerQuery = from x in db.tblCMOEnrollment
                     where ...
                     select ...;
    
    var query = from a in vwPersonInfo
                join b innerQuery on p.PersonID equals cp.ClientID
                select ...;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am struggling to write a query based on the table below that should
I'm struggling to write a Windows Service that accesses a website, logs in using
I'm struggling to write Makefiles that properly build my unit tests. As an example,
I am struggling to write/configure a ThrowsAdvice interceptor that I want to intercept all
I'm struggling to write a test that confirms that I am correctly unsubscribing from
I'm struggling to write a reg-ex that can do the following: Label1.Caption := Edit1.Text;
I'm struggling to write a perl-compatible regex that will be reasonably smart about distinguishing
I am struggling to write a query to result in the following records. I
I am struggling to understand why the initialization of pprocessor, below, is written like
I'm struggling with Haskell programming. I've got the list below and I want to

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.