Skip to Content
0
Former Member
Feb 16, 2011 at 03:38 PM

Sales Per Person, Per Department Query

37 Views

Hi All,

I am trying to write a query to allow me to get the Sales Figures per Employee (by Owner Code) per Department. I will then turn this into a Crystal Report so that I can do A Sales Report by Department.

I Have this so far :

SELECT T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal], T0.[OwnerCode], T1.[dept] FROM OINV T0 INNER JOIN OHEM T1 ON T0.OwnerCode = T1.empID WHERE T0.[DocDate] >=[%0] AND T0.[DocDate] <=[%1]

However rather than have a number for the Sales Employee and Department I would like to see their names and their department name. Could someone point me in the right direction please and advise the correct joins. I also need to see the pre-VAT (Tax) figure for the Doc Total as well - really not sure what table that is in !

Much appreciated.

Kind regards

Sean Martin

Edited by: Sean Martin on Feb 16, 2011 4:38 PM

Edited by: Sean Martin on Feb 16, 2011 4:38 PM