Skip to Content

Why is the result incorrect in this query report?

Oct 05, 2017 at 12:47 PM


avatar image


I have made this query to give me a summary of what each customer has purchased from our suppliers, but the results is way off.

There is an error in the query, but I'm not able to see it!

SELECT T4."FirmName", SUM(T1."LineTotal") AS Total FROM OINV T0 INNER JOIN INV1 T1 ON T0."DocEntry" = T1."DocEntry" INNER JOIN OITM T2 ON T1."ItemCode" = T2."ItemCode" INNER JOIN OCRD T3 ON T0."CardCode" = T3."CardCode" INNER JOIN OMRC T4 ON T2."FirmCode" = T4."FirmCode" INNER JOIN RIN1 T5 ON T2."ItemCode" = T5."ItemCode" WHERE T0."DocDate" >=[%0] AND T0."DocDate" <=[%1] AND T0."CardName" =[%2] GROUP BY T4."FirmName" ORDER BY T4."FirmName"

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers