Description;
To access the data in the Commission tables – E,g, plan names and rates for Salespersons
Pull the commission plans and rates from Storedata using SQL or Crystal as well as listings by Salespersons of the Commission Plans each are on.
None. These queries only reports. There are no changes to the Cyrious database.
Control does not provide handles to link companies or transactions to a Commission Plan. This must be done with UDFs.
E.ID as EmployeeID
, E.FirstName + ' ' + E.LastName as Salesperson
, E.CommissionPlanID
, CP.ElementName as PlanName
, CR.Rate1Salesperson1
, CR.Rate2Salesperson1
, CR.Rate2Salesperson2
, CR.Rate3Salesperson1
, CR.Rate3Salesperson2
, CR.Rate3Salesperson3
FROM Employee E WITH(NOLOCK)
– The element table is what stores the plans.
LEFT JOIN Element CP WITH(NOLOCK) ON CP.ID = E.CommissionPlanID AND CP.ClassTypeID = 13000
– The commission rate stores the rates for the plan.
LEFT JOIN CommissionRate CR WITH(NOLOCK) on CR.CommissionPlanID = CP.ID
– filter out all employees that don't have a commissionplan set.
WHERE ISNULL(E.CommissionPlanID,0) > 0
Contributor: Steve Gillispie based on input and code from Brandon , Acorn Sign Graphics
Date: 717/2017
Version: Control 6.1_