Help on Counting Query

K

kr

I have an employee dbs that we use to keep track of all employee info. We
are beginning to use the dbs for more - to keep track of schedules and # of
employees on duty in an hour. I am stumped. I need help starting with the
tables and then i would to end up with rpt or crosstab similar to this:

Mon Tues Wed Thurs Fri Sat Sun
7am 8 9 10
8am 8
9am 8
10am
etc - this would give me the # of employees who are working in these
hours/days. I have tried many steps to do this - 2 tables one w/the hours
and the other tbl w/employee nm/id and start/end times. But I dont know how
to put it all together to get the results I need. Can you help, please? :)
PS - we have different shifts throughout the day - that is why the # of
employees during a particular hour can change.
 
D

Duane Hookom

I would create at least 3 tables:
tblDates (one record for every date in range needed)
============
TheDate date/time

tblTimes (one record for every hour of the day)
============
TheTime date/time

tblEmployeeWork
=============
EmployeeID
WorkDate
WorkTimeStart
WorkTimeEnd

You could then create a query with all three tables. Join the TheDate field
to the WorkDate field. Then set the criteria under the TheTime field to
Between WorkTimeStart and WorkTimeEnd
 
K

kr

okay. great. i will try that. then from there could i turn it into a
calculated field?
now, with the info we need - it won't be a dated rpt necessarily - just a
general overview - but it should work. i wil try.
 
D

Duane Hookom

Actually, from the tables I suggested, you should be able to create the
desired output using a crosstab query.
 
K

kr

oh - gotcha! Thanx for your help!

Duane Hookom said:
Actually, from the tables I suggested, you should be able to create the
desired output using a crosstab query.
 

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