Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Comparing data of two same tables but different records using query?

$
0
0

Hi,

I have 1 table (InventTable). I want to compare the itemId of its 2 records using query. 

query = new Query();
dsInventTable = query.addDataSource(tableNum(InventTable), tableStr(InventTableA));
dsInventTable = dsInventTable.addDataSource(tableNum(InventTable), tableStr(InventTableB));
dsInventTable.relations(true);
dsInventTable.joinMode(JoinMode::ExistsJoin);

dsInventTable.addRange(fieldNum(InventTable, ItemId)).value(strFmt('(%1 == %2)',

strFmt("%1.%2", qbds.name(), fieldStr(InventTable, ItemId)),

strFmt("%2.%2", qbds.name(), fieldStr(InventTable, ItemId))));

 

But this does not work, how should I write the code for InventTableB?


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>