Dear Experts,
I hope I am now on the right place upon my problem.
I am generating a query in which I wanted to have a collapsing/expanding result based on the group by from the Document number of Journal entry. But the result I got is on the screenshot below.
I boxed the doc num of JE = 100646, this is the sample doc that I wanted to have the group by function.
here is my query:
SELECT
T4.Code,
T0.DocDate as 'Date',
T0.DocNum,
T2.DocNum as 'AR Doc.#',
T0.CardCode as BPCode,
T3.CardName as BPName,
T3.Address,
T0.CounterRef as 'Ref',
T0.TransId As 'Transaction No.',
T3.LicTradNum as TIN,
T1.Debit
FROM dbo.ORCT AS T0
LEFT join JDT1 T1 ON T0.DocNum = T1.BaseRef
LEFT JOIN OINV t2 ON t0.DocNum = t2.ReceiptNum
LEFT JOIN OCRD T3 ON T0.CardCode = T3.CardCode
LEFT JOIN OFPR T4 ON T0.FinncPriod = T4.AbsEntry
Inner JOIN OACT T5 on T1.Account = T5.AcctCode
where T1.Account='_SYS00000000301' and t4.Code=[%]
The result that I wanted to have is just like from the incoming payments form where it has that collapsing/expanding result for the purpose of Excel transfer and to return one value for the debit only as per one Journal entry.