Skip to Content
0
Former Member
Sep 14, 2009 at 01:03 AM

TOP10 salesman

13 Views

Hi expert good Morning,

if anyone can help me to solve my problem

1) I want to add a total shopping month-1 how to add an existing Query

SELECT top 10 T0.Cardcode,max(T0.CardName) as 'Customer',Sum(T0.doctotal) as 'Total Shopping' from dbo.ORDR T0

WHERE Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())

Group by T0.Cardcode

Order by Sum(T0.doctotal) desc

ex:

1) customer vendor | costomer | total shopping this month (september) | total shopping month (augustus)

AND

2) I want to add a Top 10 salesman sales month-1 how to add an existing Query

SELECT top 10 max(T1.SLPName) as 'SalesRep',Sum(T0.doctotal) as 'Total Shopping' from dbo.OINV T0

INNER JOIN dbo.OSLP T1 ON T1.SLPCode = T0.SLPCode

WHERE Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())

Group by T0.SLPcode

Order by Sum(T0.doctotal) desc

Ex:

1) sales Rep | Total shopping this month (september) | total shopping month (augustus)

thx.