Hoje tive que fazer o seguinte select funcionar no ax:
SELECT a.CommissionGroupId, SUM(b.LineAmount)
FROM InventTable a INNER JOIN CustInvoiceTrans b ON a.itemid = b.itemid
WHERE b.invoiceid = ‘U000033’
GROUP BY a.CommissionGroupId;
Esse select, traduzido pra X++ fica:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | static void calculateCommission(Args _args) { InventTable inventTable; CustInvoiceTrans custInvoiceTrans; ; while select CommissionGroupId from inventTable group by CommissionGroupId join sum(LineAmount) from custInvoiceTrans where custInvoiceTrans.itemId == inventTable.ItemId && custInvoiceTrans.invoiceId == "U000033" { ....... } } |
[]s
4 Responses
www.nwci.info
19|Oct|2016 1Consuming them as a part of a meal, after which brushing
your tooth, is best than between meals as snacks.
Ssrs Web Hosting | Tip Top Webhosting
25|Dec|2016 2[…] Select com Join, Sum() e Group by by … – Hoje tive que fazer o seguinte select funcionar no ax: SELECT a.CommissionGroupId, SUM(b.LineAmount) FROM InventTable a INNER JOIN CustInvoiceTrans b ON a … […]
www.shopping-ind.com.br
01|Nov|2017 3Adestramento dentre sites Loja Executvel Faa com Profissionais!
Pedro Bernardo
01|Nov|2017 4Em grau superior que duplicao da medida a algum outra aoteia.
Leave a reply
Search
Tags / Categorias
RSS
Arquivo
Blogroll