Code:
PARAMETERS d DateTime, b DateTime; SELECT * FROM ( TRANSFORM Sum(Vaclist.Period) AS SumOfPeriod SELECT Vaclist.EmpID, Vaclist.Vactype FROM qryEmployeeWorkDates LEFT JOIN Vaclist ON (qryEmployeeWorkDates.EmpID = Vaclist.EmpID) AND (qryEmployeeWorkDates.DateOfPeriod = Vaclist.VacDate) WHERE (((qryEmployeeWorkDates.DateOfPeriod) Between [d] And [b])) GROUP BY Vaclist.EmpID, Vaclist.Vactype PIVOT qryEmployeeWorkDates.DateOfPeriod ) t WHERE EmpID IS NOT NULL;
Comment