Hi Vinod,
To get the sum of the two fields per line, you have to remove the DocDate from the GroupBy, if you filter by it you put it just into the where Clause.
There is also no need to the Distinct function.
your query will look like that :
Select T0.CARDCODE,T0.CARDNAME,Sum(T0.DOCTOTAL) AS 'DocTotal'
FROM OINV T0
INNER JOIN INV1 T1 ON T0.DOCENTRY = T1.DOCENTRY
INNER JOIN OCRD ON T0.CARDCODE = OCRD.CARDCODE
WHERE T1.TARGETTYPE <> 14
AND OCRD.QryGroup1 = 'Y'
AND T0.[DocDate] > [%0] AND T0.[DocDate] < [%1]
Group by T0.CARDCODE,T0.CARDNAME
Please add the other fields to the query, I don't have them in my Database.
Regards,
Mohamed.