Query2_1
SELECT Test.Name, "H" AS cnt, Format([Holidaydate],'dd') AS [Day]
FROM Holidays, Test
GROUP BY Test.Name, "H", Format([Holidaydate],'dd');
Query2_2
SELECT Test.Name, "W" AS Cnt, Format([WeekendDate],'dd') AS [Day]
FROM tblWeekendDates, Test
GROUP BY Test.Name, "W", Format([WeekendDate],'dd');
Query2
SELECT Test.Name, Count(nz([Name],0)) AS Cnt, Format([Time],'dd') AS [Day]
FROM Test
GROUP BY Test.Name, Format([Time],'dd'), addweekenddates(#9/1/08#,#9/30/08#)
UNION
SELECT Query2_1.Name, Query2_1.cnt, Query2_1.Day
FROM Query2_1 LEFT JOIN Test ON (Query2_1.Day = format(Test.Time,"DD")) AND (Query2_1.Name = Test.Name)
WHERE (((Test.Name) Is Null))
UNION
SELECT Query2_2.Name, Query2_2.Cnt, Query2_2.Day
FROM Query2_2 LEFT JOIN Test ON (Query2_2.Day = format(Test.Time,"DD")) AND (Query2_2.Name = Test.Name)
WHERE (((Test.Name) Is Null));
|