Averages

N

Nadia N

Hi to all and thanks for your help earlier Glenn.
I have another scenario that i need help with.
I have a table with the following fields:
"InspID":primary key:assigns a unique auto number to each
record

"InspUnitID":has a unit number in it that appears like
76U1234

"InspEmployee":has the an employee id such as 22345

"InspDate":tracks the actual date the employee entered data
(inspections)

"InspTime":tracks the actual time the employee entered data
(inspections)

Now what i need to do is determine average daily
inspection output by each employee using units reported
and hours/days worked. Once this is obtainable I need to
compile a group average as well. If any one has any
suggestions or ideas they are much appreciated. I'm lost
completely at what direction to take here. I know i have
to make up a query but from there i don't know how to get
what i need. Plz help.

Thanks much in advance!

~Nadia
 
M

Michel Walsh

Hi,


SELECT InspUnitID, InspEmployee, InspDate, AVG(InspTime)
FROM tableName
GROUP BY InspUnitID, InspEmployee, InspDate

UNION ALL

SELECT InspUnitID, NULL, InspDate, AVG(InspTime)
FROM tableName
GROUP BY InspUnitID, InspDate



The first part supply the average, by employee (by unit), while the second
supply the average by unit (ie, over all the employee in the same unit).
Note that I use NULL to have four fields, like in the first part, using NULL
(not applicable) for the second part the vis-a-vis of the first part
InspEmployee.


Hoping it may help,
Vanderghast, Access MVP
 

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