https://shyamkannadasan.blogspot.com/2017/10/vendor-bank-details-sql-query-in-ax.html 


Hérna er grunnur fyrir eftirlitið:

 SELECT distinct VENDTABLE.DATAAREAID ENTITY, VENDTABLE.ACCOUNTNUM, DIRPARTYTABLE.NAME,Address.ADDRESS ,
 VENDTABLE.CURRENCY ,VENDTABLE.VENDGROUP ,
 VENDTABLE.PAYMTERMID,VENDTABLE.TAXGROUP VATGROUP ,VENDTABLE.CASHDISC ,
 VendBankAccount.ACCOUNTID BankAccount ,VendBankAccount.NAME 'Bank Name' ,VendBankAccount.ACCOUNTNUM 'Bank account number',
 VendBankAccount.RegistrationNum 'Routing Number',VendBankAccount.SWIFTNo,VendBankAccount.BankIBAN
 from VENDTABLE left outer JOIN VendBankAccount ON VendBankAccount.VENDACCOUNT = VENDTABLE.ACCOUNTNUM --AND  VendBankAccount.ACCOUNTID = VENDTABLE.BANKACCOUNT
 left outer join DIRPARTYTABLE ON DIRPARTYTABLE.RECID = VENDTABLE.PARTY
 left outer join LOGISTICSPOSTALADDRESS AS Address ON Address.LOCATION = DIRPARTYTABLE.PRIMARYADDRESSLOCATION
  WHERE VENDTABLE.DATAAREAID IN ('companyLE') --and VENDTABLE.ACCOUNTNUM ='test033'
 Order by  VENDTABLE.DATAAREAID,VENDTABLE.ACCOUNTNUM