Hi
IN below code i am getting error T0.docentry is invalid because of Group By
SQL
SELECT Sum(T0."DpmAmnt") - (Select Sum(A0."DrawnSum") from ACH9 A0 where A0."BaseDocNum" = T0."DocEntry") As "NetAmount"
FROM ODPR T0 WHERE T0."CardCode" = 'S04563'Hi
IN below code i am getting error T0.docentry is invalid because of Group By
SELECT Sum(T0."DpmAmnt") - (Select Sum(A0."DrawnSum") from ACH9 A0 where A0."BaseDocNum" = T0."DocEntry") As "NetAmount"
FROM ODPR T0 WHERE T0."CardCode" = 'S04563'Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 21, 2024, 11:33 AM EST
Hello Ramco,
Please use the below query to make it work as expected..
SELECT SUM(T0."DpmAmnt") - COALESCE((SELECT SUM(A0."DrawnSum") FROM ACH9 A0 WHERE A0."BaseDocNum" = T0."DocEntry"), 0) AS "NetAmount" FROM ODPR T0 WHERE T0."CardCode" = 'S04563';