Here is the code I tried:SELECT Task.OutlineNum, SUM(Time.StandardHours) AS HoursFROM Project INNER JOIN Task ON Project.ProjectCode = Task.ProjectCode AND Project.RevisionNum = Task.RevisionNum LEFT OUTER JOIN Time ON Task.ProjectCode = Time.ProjectCode AND Task.TaskUID = Time.TaskUIDWHERE (Project.RevisionStatusCode = N'A') AND (Project.ProjectCode = '12345')GROUP BY Task.OutlineNum WITH ROLLUP
This is what I should have gotten:Project OutlineNum Hours12345 0 1190.512345 1 1190.512345 1.1 162.2512345 1.2 48.2512345 1.3 83.7512345 1.3.1 1812345 1.3.2 0.2512345 1.3.3 0.2512345 1.3.4 0.2512345 1.3.5 17.512345 1.3.6 1912345 1.3.7 12345 1.3.8 28.512345 1.4 174.512345 1.4.1 7.512345 1.4.2 612345 1.4.3 21.512345 1.4.4 4712345 1.4.5 12345 1.4.6 12345 1.4.7 1012345 1.4.8 3012345 1.4.8.1 1012345 1.4.8.2 2012345 1.4.8.3 12345 1.4.8.4 12345 1.4.9 1412345 1.4.9.1 612345 1.4.9.2 812345 1.4.9.3 12345 1.4.9.4 12345 1.4.10 38.512345 1.4.10.1 812345 1.4.10.2 29.512345 1.4.10.3 12345 1.4.10.4 112345 1.5 2212345 1.6 241.2512345 1.6.1 9.7512345 1.6.2 42.7512345 1.6.3 69.512345 1.6.4 30.512345 1.6.5 812345 1.6.6 80.7512345 1.7 15512345 1.7.1 3812345 1.7.2 26.512345 1.7.3 40.7512345 1.7.4 4712345 1.7.5 2.7512345 1.8 153.512345 1.8.1 12.2512345 1.8.2 1212345 1.8.3 21.2512345 1.8.4 3812345 1.8.5 2112345 1.8.6 1812345 1.8.7 1312345 1.8.8 1812345 1.9 15012345 1.9.1 12345 1.9.2 59.512345 1.9.3 12345 1.9.4 77.2512345 1.9.4.1 26.512345 1.9.4.2 50.7512345 1.9.4.3 12345 1.9.4.4 012345 1.9.4.4. 1 12345 1.9.4.5 17.2512345 1.9.5 13.2512345 2 012345 2.1 12345 2.2 12345 3 012345 3.1 012345 3.1.1
This is what I got:OutlineNum Hours0 NULL1 NULL1.1 162.251.2 48.251.3 NULL1.3.1 18.001.3.2 0.251.3.3 0.251.3.4 0.251.3.5 17.501.3.6 19.001.3.7 NULL1.3.8 28.501.4 NULL1.4.1 7.501.4.10 NULL1.4.10.1 8.001.4.10.2 29.501.4.10.3 NULL1.4.10.4 1.001.4.2 6.001.4.3 21.501.4.4 47.001.4.5 NULL1.4.6 NULL1.4.7 10.001.4.8 NULL1.4.8.1 10.001.4.8.2 20.001.4.8.3 NULL1.4.8.4 NULL1.4.9 NULL1.4.9.1 6.001.4.9.2 8.001.4.9.3 NULL1.4.9.4 NULL1.5 22.001.6 NULL1.6.1 9.751.6.2 42.751.6.3 69.501.6.4 30.501.6.5 8.001.6.6 80.751.7 NULL1.7.1 38.001.7.2 26.501.7.3 40.751.7.4 47.001.7.5 2.751.8 NULL1.8.1 12.251.8.2 12.001.8.3 21.251.8.4 38.001.8.5 21.001.8.6 18.001.8.7 13.001.8.8 18.001.9 NULL1.9.1 NULL1.9.2 59.501.9.3 NULL1.9.4 NULL1.9.4.1 26.501.9.4.2 50.751.9.4.3 NULL1.9.4.4 NULL1.9.4.4.1 0.001.9.4.5 17.251.9.5 13.252 NULL2.1 NULL2.2 NULL3 NULL3.1 NULL3.1.1 NULLNULL 1207.75
Thanks,Alan