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)

join claus

(0) ShareShare
ReportReport
Posted on by 406

how can i select multi column from table & table rafrenced as ansi

*This post is locked for comments

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

    If you don't specify individual columns, all columns are returned (if it's not an exist/notexist join, of course). If you want just some columns, do it this way:

    (...)
    join Field1, Field2 from myTable 
    (...)

    The complete syntax is documented at MSDN.

    What do you mean by "table rafrenced as ansi"?

  • shelpaya Profile Picture
    406 on at

    thank you for your post  ;

    when i select from table1&table2 using join in ansi

    select table1.column,table2.column from table1 join table2 on table1.cc=table2.cc

    how can i do this in ax ?

  • Suggested answer
    Ali Zaidi Profile Picture
    4,657 on at

    fields names in join Claus is not possible in dynamics ax, if in query two tables are joined, all fields will be available for example if want to get customer Account number with Customer i have to take join between customer table and DirPartyTable like below

    CustTable custtable;

        DirPartyTable dptable,custparty;

       while SELECT *

       FROM  custtable

           join custparty

       where  custparty.RecId==custtable.Party

       {

       info(custtable.AccountNum +'  '+ custparty.Name);

       }

  • Suggested answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Your query:

    select table1.column,table2.column from table1 join table2 on table1.cc=table2.cc

    translated to X++:

    Table1 table1;
    Table2 table ;
    
    select column from table1
        join column from table2
        where table2.cc=table1.cc;

    You can use field lists with joins, don't worry.

    If you don't know basics, it's absolutely essential to familiarize yourself with the documentation - it's all there. And you can find many examples in the standard AX codebase.

  • Ali Zaidi Profile Picture
    4,657 on at

    Martin, You are right, I missed the syntax for column names with joins, its working perfectly write. It will really helpful for me too. I am also in learning process.

    CustTable custtable;

        DirPartyTable dptable,custparty;

       while SELECT

        AccountNum from custtable

           join Name from custparty

       where  custparty.RecId==custtable.Party

       {

       info(custtable.AccountNum +'  '+ custparty.Name);

       }

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans