on 2022 Feb 11 3:29 PM
Hi all,
I have the query below, i want the result to be all months available in the database in a cumulative way, can someone help me? I should add that i want to use this query in a stored procedure using an input parameter for date.
Select
'Assets' as "Group Mask"
,case when t0.FatherNum = 'A20' then 'AR'
when t0.FatherNum in ('A40','A50') then 'OCA'
when t0.FatherNum = 'A90' then 'FA'
when t0.FatherNum = 'A10' then 'CASH'
else 'Other' end as "Classification"
,eomonth(t1.RefDate) as "Date"
,t0."AcctName" "Account Name"
,(SUM(t1."Debit") - sum(t1."Credit")) as Balance
FROM OACT t0 -- G/L Accounts
inner join JDT1 t1 ON T0."AcctCode" = T1."Account"
where t0."GroupMask" = 1
group by
t0."AcctName"
,t0.FatherNum
,eomonth(t1.RefDate)
,t1."Credit"
,t1."Debit"
,t1."Account"<br>
Request clarification before answering.
User | Count |
---|---|
105 | |
39 | |
6 | |
5 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.