Developer2U
Programmer
What I'm trying to do is display a row of column totals at the bottom of a crosstab query. I can easily get the row total. What I'm trying to show is the number of hours worked on a project per each employee.
The current crosstab looks like this:
Code:
EmployeeA EmployeeB
XYZ 15 17.0
XZX 20 5.5
Total 35 22.5
The current crosstab looks like this:
Code:
PARAMETERS [@Task_Order_Number] Text ( 20 ), [@BeginDate] DateTime, [@EndDate] DateTime;
TRANSFORM NZ(Sum(c.Hours),0) AS SumHours
SELECT e.ProjCode, Sum(c.Hours) AS [Total Hours]
FROM TaskOrder_tbl AS b INNER JOIN ((QA_Rep_tbl AS d INNER JOIN Task_tbl AS a ON d.UserID = a.UserID) INNER JOIN (Project_tbl AS e INNER JOIN Task_Details_tbl AS c ON e.ProjectID = c.ProjectID) ON a.TaskID = c.TaskID) ON b.TaskOrderID = c.TaskOrderID
WHERE b.TaskOrderID = [@Task_Order_Number] AND (a.TaskDate BETWEEN [@BeginDate] AND [@EndDate])
GROUP BY e.ProjCode
PIVOT d.User;