N
Notch Johnson
My dilemma, I'm trying to create a Comission Report for
my firm, pulling the data from our accounting software.
The only thing I can't figure out how to do is: if the
practice class = 10, then the commission would be $125
but if the practice class = 04 then the commission is 25%
of the fee paid, while all other practice classes have a
commission of 20% of the fee paid. Is that making sense
to anyone?
Here is my query:
SELECT Right([CliCode],6) AS Expr1, Client.CliNickName,
Matter.MatCode, Matter.MatNickName, Employee.EmpName, Sum
(FeeSumByPrd.FSPFeeReceived) AS SumOfFSPFeeReceived,
Matter.MatPracticeClass
FROM (((Matter INNER JOIN Client ON Matter.MatCliNbr =
Client.CliSysNbr) INNER JOIN MatOrigAtty ON
Matter.MatSysNbr = MatOrigAtty.MOrigMat) INNER JOIN
FeeSumByPrd ON MatOrigAtty.MOrigMat =
FeeSumByPrd.FSPMatter) INNER JOIN Employee ON
MatOrigAtty.MOrigAtty = Employee.EmpSysNbr
GROUP BY Right([CliCode],6), Client.CliNickName,
Matter.MatCode, Matter.MatNickName, Employee.EmpName,
Matter.MatPracticeClass, Employee.EmpInitials,
FeeSumByPrd.FSPPrdNbr, FeeSumByPrd.FSPPrdYear
HAVING (((Sum(FeeSumByPrd.FSPFeeReceived))<>0) AND
((Employee.EmpInitials)=[Initials:]) AND
((FeeSumByPrd.FSPPrdNbr)=[Month:]) AND
((FeeSumByPrd.FSPPrdYear)=[Year:]))
ORDER BY Right([CliCode],6), Matter.MatCode;
my firm, pulling the data from our accounting software.
The only thing I can't figure out how to do is: if the
practice class = 10, then the commission would be $125
but if the practice class = 04 then the commission is 25%
of the fee paid, while all other practice classes have a
commission of 20% of the fee paid. Is that making sense
to anyone?
Here is my query:
SELECT Right([CliCode],6) AS Expr1, Client.CliNickName,
Matter.MatCode, Matter.MatNickName, Employee.EmpName, Sum
(FeeSumByPrd.FSPFeeReceived) AS SumOfFSPFeeReceived,
Matter.MatPracticeClass
FROM (((Matter INNER JOIN Client ON Matter.MatCliNbr =
Client.CliSysNbr) INNER JOIN MatOrigAtty ON
Matter.MatSysNbr = MatOrigAtty.MOrigMat) INNER JOIN
FeeSumByPrd ON MatOrigAtty.MOrigMat =
FeeSumByPrd.FSPMatter) INNER JOIN Employee ON
MatOrigAtty.MOrigAtty = Employee.EmpSysNbr
GROUP BY Right([CliCode],6), Client.CliNickName,
Matter.MatCode, Matter.MatNickName, Employee.EmpName,
Matter.MatPracticeClass, Employee.EmpInitials,
FeeSumByPrd.FSPPrdNbr, FeeSumByPrd.FSPPrdYear
HAVING (((Sum(FeeSumByPrd.FSPFeeReceived))<>0) AND
((Employee.EmpInitials)=[Initials:]) AND
((FeeSumByPrd.FSPPrdNbr)=[Month:]) AND
((FeeSumByPrd.FSPPrdYear)=[Year:]))
ORDER BY Right([CliCode],6), Matter.MatCode;