Ramco Ramco

Ramco Ramco

  • 435
  • 3.4k
  • 546.7k

How to display Sum of last 2 columns

Dec 26 2024 6:54 AM

Hi

  I have below query . I want to display sum of the last 2 columns at the Bottom.

SELECT  T3."ShortName" AS "Vendor Code",(Select Max("CardName") from OCRD where "CardCode" = T3."ShortName") AS "Vendor Name",T3."Debit", T3."Credit" 
FROM OJDT  T2 INNER JOIN JDT1 T3 ON T2."TransId" = T3."TransId" WHERE 
(T3."ShortName"=:Vendor )
UNION ALL
SELECT T2."CardCode" AS "Vendor Code",T2."CardName" AS "Vendor Name",(T2."DocTotal") + (T2."DpmAmnt") + (T2."DpmVat"),0
FROM OINV T2
WHERE (T2."CardCode"=:Vendor ) 

Thanks


Answers (4)