What I posted was a query. YOu would paste that into the SQL view of a
query. Adjust the Table and Field names to match your table and field names.
The additional table would be a table of Dates covering the range of
dates you have in your project table. Then you would have to use a more
complex query joining your projects table to the Dates table.
SELECT Format(Dates.TheDate,"yyyy-mm") as TheMonth
,[Position of Employee]
, Count([Position of Employee]) as CountPosition
FROM Project INNER JOIN Dates
ON Dates.TheDate >= Project.FromDate
AND Dates.TheDate <= Project.ToDate
GROUP BY Format(Dates.TheDate,"yyyy-mm")
,[Position of Employee]
You can filter that by adding a where clause against Dates.TheDate. For
instance the following would get the information for the months of 2008.
SELECT Format(Dates.TheDate,"yyyy-mm") as TheMonth
,[Position of Employee]
, Count([Position of Employee]) as CountPosition
FROM Project INNER JOIN Dates
ON Dates.TheDate >= Project.FromDate
AND Dates.TheDate <= Project.ToDate
WHERE Dates.TheDate Between #2008-01-01# and #2008-12-31#
GROUP BY Format(Dates.TheDate,"yyyy-mm")
,[Position of Employee]
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================