Skip to Content
0
Jan 10, 2015 at 05:47 AM

Top 10 Sales Item Report

291 Views

Hi Experts,

Am using the following query to get Top 10 Sales Items Report.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SELECT TOP 20 T1.ItemCode, T2.ItemName, cast(sum(T1.Quantity) as numeric) as 'Quantity Sold', sum(T1.LineTotal - T1.VatSum) as 'Total Net Value', sum(T1.LineTotal) as 'Total Gross Value', T1.Currency

FROM dbo.INV1 T1

LEFT OUTER JOIN OITM T2 on T1.ItemCode = T2.ItemCode

WHERE T1.ItemCode is not null

GROUP BY T1.ItemCode, T2.ItemName, T1.Currency

order by sum(T1.Quantity) desc

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Now I wand to return this report between a date range. How its possible

Please help Me

Thanks & Regards.