Query problems

H

happywitchie

Hi

I have a table that contains the following fields I am interested in:
Project (contains the name of the project)
Person (person name)
Status (contains employee status, e.g Full-time, contractor etc)

I want to create a form that lists the project name together with the
total number of contractors, full-timers, part-timers etc for that
project. So my output needs to look like

Project Full-Time Part-time Contractor
===================================
Project1 9 0 2
Project2 6 1 2

I am having a lot of trouble trying to write a query that will do this.
Can anyone offer any suggestions?

Thanks
 
R

Rob Parker

You need a crosstab query. Try this:

TRANSFORM Count(Person)
SELECT Project FROM YourTableName GROUP BY Project
PIVOT Status;

Substitute the name of your table for YourTableName .

HTH,

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top