SELECT e.EmpName Timekeeper, Sum(f.FSPWorkedHrsEntered) [Hrs Worked], Sum(f.FSPNonBilHrsEntered) [NonBillable Hrs], Sum(f.FSPBilHrsEntered) [Billable Hrs],
Round((Sum(f.FSPBilHrsEntered) / 12) * 12, 2) [Annualized Billable Hrs], Sum(f.FSPHrsBilled) [Hrs Billed], Sum(f.FSPFeeBldActualAmt) [Fees Billed],
Round(Sum(f.FSPFeeBldActualAmt) / Sum(f.FSPHrsBilled), 2) [Avg Billed Rate], Sum(f.FSPFeeReceived) [Fees Received], u.[Unbilled Amount], e.Goal, (((e.Percent1 * 11192186.41) / 1000000) +
((e.Percent2 * 0) / 1000000) + ((e.Percent3 * 0) / 1000000) + ((e.Percent4 * 0) / 1000000)) [Taxable Income], ((100000 / 12) * 12) Cost,
(Sum(f.FSPFeeBldActualAmt) - (((e.Percent1 * 11192186.41) / 1000000) + ((e.Percent2 * 0) / 1000000) + ((e.Percent3 * 0) / 1000000) + ((e.Percent4 * 0) / 1000000)) - ((100000 /
12) * 12)) [Profit/Loss]
FROM (SELECT e1.EmpSysNbr Timekeeper, Sum(u1.UTAmount) [Unbilled Amount]
FROM dbo.UnbilledTime u1
INNER JOIN dbo.Employee e1 ON u1.UTTkpr = e1.EmpSysNbr
GROUP BY e1.EmpSysNbr) u
INNER JOIN dbo.Employee e ON u.Timekeeper = e.EmpSysNbr
INNER JOIN dbo.FeeSumByPrd f ON e.EmpSysNbr = f.FSPTkpr
WHERE f.FSPPrdYear = 2009 AND f.FSPPrdNbr BETWEEN 1 AND 12 AND e.EmpSysNbr NOT IN (103, 109, 56, 68, 88, 105, 44, 34, 174, 147, 46, 29, 37, 201, 148, 69, 36, 45)
AND e.EmpPrsTyp = '01'
GROUP BY e.EmpName, u.[Unbilled Amount], e.Goal, e.EmpPrsTyp, e.Percent1, e.Percent2, e.Percent3, e.Percent4
HAVING Sum(f.FSPWorkedHrsEntered) > 0
ORDER BY e.EmpName, e.EmpPrsTyp
|