Code: Select all
TRANSFORM Sum(RRHH!Hours) AS [Hours by Year]
SELECT RRHH.NumCaso, Proyects.NameProy, Peopole.Lastnames, Peopole.Name, RRHH.Cargo, Sum(RRHH!ValueHoursMan*RRHH!Hours) AS Total
FROM Proyects INNER JOIN (Peopole INNER JOIN RRHH ON Peopole.IdPeopole=RRHH.IdPeopole) ON Proyects.NumCaso=RRHH.NumCaso
WHERE (((Year(RRHH!Date))=2007))
GROUP BY RRHH.NumCaso, Proyects.NameProy, Peopole.Lastnames, Peopole.Name, RRHH.Cargo
PIVOT Month(RRHH!Date);
NumCaso, NameProy, Lastnames, Name, Cargo, Total, jan, feb.....
hours month by month, but I need the amount of money month by month, I mean for January Sum(RRHH!ValueHoursMan*RRHH!Hours) on January, the same for feb etc...