japeconsulting
Programmer
I need to amend the following query so that I get ALL records from the OACT table. Because I am grouping by fields from other tables as there are no records for some of the accounts in this OACT table it is not including all of the accounts. Could someone assist as to how I can modify this query to do this please?
SELECT T0.FatherNum,
T0.FormatCode,
T3.F_RefDate,
T3.SubNum,
T2.FinncPriod,
SUM(T1.Credit-T1.Debit) Balance,
FROM OACT T0
INNER JOIN JDT1 T1 ON T0.AcctCode = T1.Account
INNER JOIN OJDT T2 ON T1.TransId = T2.TransId and
T2.FinncPriod>={?Period} and T2.FinncPriod<={?Period2}
INNER JOIN SBOMDEV01_Live.dbFPR T3 ON T2.FinncPriod=T3.AbsEntry
LEFT OUTER JOIN SBOMDEV01_Live.dbBGT T4 ON T0.AcctCode=T4.AcctCode AND T4.Instance=2
WHERE T0.ActType in ('I','E')
GROUP BY
T0.FatherNum,
T0.FormatCode,
T2.FinncPriod,
T3.F_RefDate,
T3.SubNum
Thanks so much.
SELECT T0.FatherNum,
T0.FormatCode,
T3.F_RefDate,
T3.SubNum,
T2.FinncPriod,
SUM(T1.Credit-T1.Debit) Balance,
FROM OACT T0
INNER JOIN JDT1 T1 ON T0.AcctCode = T1.Account
INNER JOIN OJDT T2 ON T1.TransId = T2.TransId and
T2.FinncPriod>={?Period} and T2.FinncPriod<={?Period2}
INNER JOIN SBOMDEV01_Live.dbFPR T3 ON T2.FinncPriod=T3.AbsEntry
LEFT OUTER JOIN SBOMDEV01_Live.dbBGT T4 ON T0.AcctCode=T4.AcctCode AND T4.Instance=2
WHERE T0.ActType in ('I','E')
GROUP BY
T0.FatherNum,
T0.FormatCode,
T2.FinncPriod,
T3.F_RefDate,
T3.SubNum
Thanks so much.