Hi
Even if remove where condition in SQL, iam not getting such error message.
SELECT Distinct(T1.ItemCode), T1.Dscription,SUM(T1.Quantity),SUM(T1.LineTotal),SUM(T1.GrssProfit ),Case WHEN Sum(Isnull(T1.LineTotal,0)) = 0 THEN 0 ELSE
SUM(IsNUll(T1.GrssProfit ,0))/Sum(isnull(T1.LineTotal,0)) * 100 END 'Gross Profit %' FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry GROUP BY T1.ItemCode, T1.Dscription
Thanks
SELECT Distinct(T1."ItemCode"),T1."Dscription",SUM(T1."Quantity"),SUM(T1."LineTotal"),
SUM(T1."GrssProfit" ),(SUM(T1."GrssProfit" )/SUM(T1."LineTotal"))*100 AS "GP" FROM "STC_LIVE"."OINV" T0 INNER JOIN "STC_LIVE"."INV1" T1
ON T0."DocEntry" = T1."DocEntry"
WHERE T0."CardCode" = '12345' and YEAR(T0."DocDate") = '2015'
GROUP BY T1."ItemCode", T1."Dscription"
this addition give me an error
Add comment