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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

selecting record from a table that does not exist in other two tables(notexists join)

(0) ShareShare
ReportReport
Posted on by 451

Hi All,

I have  2 tables header and line each having a field x now I have to compare it with table t having field x , if the header has line we need to compare header.x   == t.x else line.x== t.x. I need to filter records where the value is present in only header I.e it has no line records and no record in table t (header.recid == line.refrecid). I was trying two not exists join but that does not work in ax

while select header 

notexists join line where line.refrecid == header.recid

notexists join t where t.x == header.x

{}

Can someone suggest an alternative?

Thanks,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Crispin John Augustine Profile Picture
    37,081 on at

    try separating them into two blocks:

    while select header 

    notexists join line where line.refrecid == header.recid

    {

    select firstOnly t where t.x == header.x

    if (!t.RecId)

    {

    //Your Code here

    }

    }

  • Suggested answer
    Community Member Profile Picture
    on at

    It needs to be written in two seperate blocks.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans