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)

convert SQL query to AX query

(0) ShareShare
ReportReport
Posted on by

I need to convert the SQL query below into AX query

select * from  PURCHRFQLINE  a  inner join PURCHRFQTABLE b on

a.RFQID=b.RFQID

inner join PURCHRFQREPLYLINE c

on c.RFQLINERECID=a.RECID

full outer join PURCHLINE d on d.Itemid=a.Itemid AND a.PURCHID = d.PURCHID

*This post is locked for comments

I have the same question (0)
  • Denis Macchinetti Profile Picture
    16,444 on at

    Hi Maram

    AX query mean AOT query or using query objects like the examples on the link below ?

    msdn.microsoft.com/.../aa638454.aspx

    Regards

  • maram fraij Profile Picture
    on at

    I need to create it firstly by code similar to the first example in the link for testing purposes then I will convert it to AOT query using the wizard

  • Suggested answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Maram

    Could be something like this :

       PURCHRFQLINE        PURCHRFQLINE;

       PURCHRFQTABLE       PURCHRFQTABLE;

       PURCHRFQREPLYLINE   PURCHRFQREPLYLINE;

       PURCHLINE           PURCHLINE;

       ;

       while select PURCHRFQLINE  

       join PURCHRFQTABLE

       where PURCHRFQLINE.RFQId == PURCHRFQTABLE.RFQId

       join PURCHRFQREPLYLINE

       Where PURCHRFQREPLYLINE.RFQLINERECID == PURCHRFQLINE.RECID

       outer join PURCHLINE

       Where PURCHLINE.Itemid     == PURCHRFQLINE.Itemid

       &&    PURCHRFQLINE.PURCHID == PURCHLINE.PURCHID

           info (PURCHRFQLINE.RFQId);

    Regards

  • Suggested answer
    Dick Wenning Profile Picture
    8,705 Moderator on at

    please check

    bmdax.blogspot.nl/.../joins-inner-outer-combined.html

    there are some issues

  • refa Profile Picture
    on at

    try to find an alternative query for FULL OUTER JOIN, combination of outer joins, unions

    but i suppose it will not work in AX...

  • Suggested answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Guys

    From my side, the above query work well.

    I have also tested on my environment.

    In this case we don't have a combination of inner join and outer join on the same source as write at the link bmdax.blogspot.nl/.../joins-inner-outer-combined.html

    Regards

  • maram fraij Profile Picture
    on at

    I need to build a query

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
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans