In SAP B1, you already have a report called "Provisional Balance" by default, and it shows you the initial Balance, Debit, Credit and Current Balance.
It's the Next:
Well here the question is to generate that same report in SAP Crystal Reports from an SQL query, I already have a query that throws me perfect data Debit and Credit, but I do not know how to get the opening balance or the current balance. / p>
This is my SQL query:
SELECT
T2.[AcctCode],
T2.[AcctName],
SUM(T1.[Debit]) AS DEBITO,
SUM(T1.[Credit]) AS CREDITO
FROM
OJDT T0 INNER JOIN JDT1 T1 ON T0.[TransId] = T1.[TransId]
INNER JOIN OACT T2 ON T1.[Account] = T2.[AcctCode]
WHERE
T1.[Account] >= '11020000'
AND T1.[Account] <='11020105'
AND T1.[RefDate] >='2017-02-01'
AND T1.[RefDate] <= '2017-02-28'
GROUP BY
T2.[AcctCode],
T2.[AcctName]
I await your answers, greetings!