Sum Query and I'm stuck

Kenln

Registered User.
Local time
Today, 08:13
Joined
Oct 11, 2006
Messages
551
I have a table with the following fields:
Employee_ID; Job_ID; Emp_Task_ID; Weekday_1; Weekday_2; Weekday_3; Weekday_4; Weekday_5; Weekday_6; Weekday_7

Each row basically records which Employee on which job preformed what task on which days (via hours).

But!!!

Let's say that I would like to know for each Job_ID how many of each Task_ID was preformed each day.

i.e. On Weekday_1 two employees preformed Task #1 and 5 employee preformed Task #2, and so on...

How would I count these???
How would I count these for each day?

I appreciate any help,

Thank you,
 
I'm trying to figure out the query or queries.
 
This should be normalized (no repeating fields) and then it isn't a problem.

But since you don't have it normalized you will need a Union Query and then use that in another query to do the Grouping/Sums.
 
Normalizing this beyond what it is would be very difficult. The PKs are Employee_ID, Job_ID and Emp_Task_ID already. The week days contain the data. I could seperate the Week Days into a seperate table but...

Everything currently accesses the table the way it is.
Also to complete the entries the user has a form in DataSheet view and the weekdays are seperate columns (fields), far easier for the user too.

If I use Unions (one Select for each day) then I will get all the days listed as a single field/column.

I'm trying to get something more like a crosstab.

But I don't even know if thats possible???
 

Users who are viewing this thread

Back
Top Bottom