Crosstab Question

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

Hi All,

I have a crosstab query that shows number of overtime hours worked per
employee in every month. Employee name is tha row header and Month is
the column header. The data I am looking at is October through March,
but the other months are still showing up in the query results with 0
values. Is there any way to get rid of these other months?
 
In query design, enter the monthsyou want (in the order you want) in the
Properties box beside the Column Headings property.

The month names go in quotes, separated by commas.
 
Include an IN clause in the query to restrict the columns to the months in
question. This also enables the columns to be returned in the correct
monthly order. Here's an example for returning the number of feet drilled
per city per month from Oct 2005 to Mar 2006:

TRANSFORM Sum(Feet)
SELECT City
FROM DrillingLog
GROUP BY City
PIVOT Format(CompleteDate,"mmm yyyy")
IN ("Oct 2005","Nov 2005","Dec 2005","Jan 2006","Feb 2006","Mar 2006");

Ken Sheridan
Stafford, England
 
In query design, enter the monthsyou want (in the order you want) in the
Properties box beside the Column Headings property.

The month names go in quotes, separated by commas.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.







- Show quoted text -


Thanks Guys!!!!!!!!!
 
Back
Top