Quantcast
Channel: SCN: Message List - Reporting and Printing
Viewing all articles
Browse latest Browse all 2719

Sales Analysis query per item group summarized per BP Group

$
0
0

Dear experts,

 

My client is requiring me to create a query that when i select a certain item group it returns a sum/total of sold items in that group per BP group

 

format:

 

parameter: Item Group A

 

BP Group A    1,000

BP Group B    2,000

BP Group C   1,000

 

I have managed to get total sales per BP Group but i cant seem to figure how to break it down per Item Group

 

here is my query:

 

SELECT T2.[GroupCode], SUM(ISNULL(T0.Debit,0) - ISNULL(T0.Credit,0)) as "Amount(LC)" FROM JDT1 T0  INNER JOIN OJDT T1 ON T0.TransId = T1.TransId and T0.TransType IN (13,14)

INNER JOIN OCRD T2 ON T2.CardCode = T0.ShortName

WHERE T1.[RefDate]  BETWEEN [%0] and [%1]

GROUP BY T2.[GroupCode]

 

how can I link Item Groups to JDT1?


Viewing all articles
Browse latest Browse all 2719

Trending Articles



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