Search code examples
sql-servermicrosoft-dynamicsdynamics-ax-2012aot

Include AND clause to query using AX AOT 2012


I want to export query from sql to dynamics so I create a AOT Query then I create view for it.

SQL QUERY

SELECT
TT.RECID,
TT.TRANSDATE,
TT.DATAAREAID,
TT.SOURCERECID,
TT.SOURCEBASEAMOUNTCUR,
TT.SOURCETAXAMOUNTCUR,
TTGJAERIVA.TAXTRANSRELATIONSHIP,
TTGJAERIVA.GENERALJOURNALACCOUNTENTRY,
TTGJAERIVA.LEDGERDIMENSION,
GJAERIVA.TEXT,
GJAERIVA.LEDGERDIMENSION AS LEDGERDIMENSIONGAE,
GJAERIVA.POSTINGTYPE
FROM TAXTRANS TT 
INNER MERGE JOIN TAXTRANSGENERALJOURNALACCOUNTENTRY TTGJAERIVA ON TTGJAERIVA.TAXTRANS = TT.RECID
INNER MERGE JOIN GENERALJOURNALACCOUNTENTRY GJAERIVA ON TTGJAERIVA.GENERALJOURNALACCOUNTENTRY = GJAERIVA.RECID 
AND GJAERIVA.POSTINGTYPE IN( 14,236,71,41)

I have all query complete with INNER JOINS except for AND clause. How can I add AND clause using Query on AX 2012?

Current query:

Query


Solution

  • You can achieve this by creating a range (under the Ranges node) on the desired table for the field you want. You can specify multiple values for the range by using comma-separated values in the Value property of the range.