C
Coach K
I need help!
I have Totals query that give me Year, MonthID, Month - Groupby. Then sum
ManhoursWorked, Recoardables, Lost Time.
I need to get rolling total for 6 and 12 Month. I have 3 tables tblYear,
tblMonth, tblSafetyDataConstruction. They are inner joined together
tblYear.Year to tblSafetyDataConstruction.Year and tblMonth.Month to
tblSafetyDataConstruction.Month.
Here is my SQL:
SELECT tblYear.Years, tblMonth.MonthID, tblMonth.Month,
Sum(tblSafetyDataConstruction.ManhoursWorked) AS SumOfManhoursWorked,
Sum(tblSafetyDataConstruction.Recordables) AS SumOfRecordables,
Sum(tblSafetyDataConstruction.LostTime) AS SumOfLostTime
FROM tblYear INNER JOIN (tblMonth INNER JOIN tblSafetyDataConstruction ON
tblMonth.Month = tblSafetyDataConstruction.Month) ON tblYear.Years =
tblSafetyDataConstruction.Year
GROUP BY tblYear.Years, tblMonth.MonthID, tblMonth.Month;
I believe I need a subquery not sure.
Thank you in advance for help!!
I have Totals query that give me Year, MonthID, Month - Groupby. Then sum
ManhoursWorked, Recoardables, Lost Time.
I need to get rolling total for 6 and 12 Month. I have 3 tables tblYear,
tblMonth, tblSafetyDataConstruction. They are inner joined together
tblYear.Year to tblSafetyDataConstruction.Year and tblMonth.Month to
tblSafetyDataConstruction.Month.
Here is my SQL:
SELECT tblYear.Years, tblMonth.MonthID, tblMonth.Month,
Sum(tblSafetyDataConstruction.ManhoursWorked) AS SumOfManhoursWorked,
Sum(tblSafetyDataConstruction.Recordables) AS SumOfRecordables,
Sum(tblSafetyDataConstruction.LostTime) AS SumOfLostTime
FROM tblYear INNER JOIN (tblMonth INNER JOIN tblSafetyDataConstruction ON
tblMonth.Month = tblSafetyDataConstruction.Month) ON tblYear.Years =
tblSafetyDataConstruction.Year
GROUP BY tblYear.Years, tblMonth.MonthID, tblMonth.Month;
I believe I need a subquery not sure.
Thank you in advance for help!!