web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to put multiple joins in a query

(0) ShareShare
ReportReport
Posted on by 20

I have tables and views a, b, c, d waiting for a query.

b needs using inner join with a,

c needs using exists join with a,

d needs using exists join with a.

So how should i put them in a query code?  I am currently putting inner join first and exist join later but the query crashes when it reaches first exist join. Please help. 

Like :

if(condition B stands )
{
qdbsB = qbdsA.addDataSource(B);
qdbsB .addLink(fieldNum(A,field A),fieldNum(B,field B));
qdbsB .joinMode(JoinMode::InnerJoin);

Range B
}

if(condition C stands )
{
qdbsC = qbdsA.addDataSource(C);
qdbsC .addLink(fieldNum(A, field A),fieldNum(C,field C));
qdbsC .joinMode(JoinMode::ExistsJoin);

Range C

}

if(condition D stands )
{
qdbsD = qbdsA.addDataSource(D);
qdbsD .addLink(fieldNum(A,field A),fieldNum(D,field D));
qdbsD .joinMode(JoinMode::ExistsJoin);

Range D
}

I have the same question (0)
  • Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    Your pseudo-code looks all right to me. What exactly do you mean by "the query crashes when it reaches first exist join"? What error are you getting?

    By the way, please use Insert > Insert Code (in the rich formatting view) to paste source code. It preserves line indentation (amoung other things), which makes code easier to read.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans