D365 Finance & Operations and Dynamics AX Forum

Expand all | Collapse all

AOT AX 2012 R3 Query using OR in the Relations

  • 1.  AOT AX 2012 R3 Query using OR in the Relations

    SILVER CONTRIBUTOR
    Posted 21 days ago
    I have a query I am converting from SQL to an AX AOT query.

    It has:

    LEFT OUTER JOIN INVENTDIMCOMBINATION IDC
    .
    .
    LEFT OUTER JOIN INVENTITEMGTIN UPC
                ON (UPC.INVENTDIMID = IDC.INVENTDIMID OR IDC.INVENTDIMID IS NULL)

    I know how to do the UPC.INVENTDIMID = IDC.INVENTDIMID section in the Relations for the outer join, but how do I handle the

    OR IDC.INVENTDIMID IS NULL   

    Probably easy to do, but I am not figuring out how to handle this.

    Thanks

    ------------------------------
    Dan Cantley
    Systems Analyst
    Bedrock Manufacturing Co, LLC
    Detroit MI
    ------------------------------
    Conference-AXUG_200x200


  • 2.  RE: AOT AX 2012 R3 Query using OR in the Relations

    SILVER CONTRIBUTOR
    Posted 20 days ago
    Ah - I need to do a UNION between the two kinds of data I pull up.  On one side of the union, I use ON (UPC.INVENTDIMID = IDC.INVENTDIMID) and have a range where IDC.INVENTDIMID  is not ''  -and on the other side I don't have a ON (UPC.INVENTDIMID = IDC.INVENTDIMID) and have a range where IDC.INVENTDIMID is ''

    It works in SQL - not to try it in AOT.

    ------------------------------
    Dan Cantley
    Systems Analyst
    Bedrock Manufacturing Co, LLC
    Detroit MI
    ------------------------------

    Conference-AXUG_200x200


If you've found this thread useful, dive deeper into User Group community content by role