Sales By Contact
What is the best way to look up sales by each contact for a specific account. For example, one of our customers has 10 sales reps. We want to see how much each individual sales rep has purchased from us during a specified period of time. We then offer a commission to these sales rep based on what they have purchased during this time.
Is there any report that can do this already or is it better to write a Query for this?
Suda Sampath replied
Are you talking about using the Contact Person on the AR Invoice for these calculations?
Sample Query to display Sales by Selected Contact Person
SELECT T1.DocNum AS 'Document Number', T1.DocDate AS 'Posting Date', T1.DocTotal, T0.Name AS 'Contact Person Name' FROM [dbo].[OCPR] T0 INNER JOIN [dbo].[OINV] T1 ON T1.CntctCode = T0.CntctCode WHERE T0.Name = '[%0]'