Using the count function

seanog2001

Registered User.
Local time
Today, 04:01
Joined
Jun 26, 2006
Messages
67
i have a table which contains the attendance records for employees. It shows their supervisor their name aemp number and which kind of hours they worked basic, overtime, Been late and absent is all recorded here.

Supervisor Emp No Surname Forename Code Value
JENNIFER BUCKLEY 200 McCormack Bridget OT1 4
JENNIFER BUCKLEY 200 McCormack Bridget OT2 1
JENNIFER BUCKLEY 200 McCormack Bridget BAS 4
JENNIFER BUCKLEY 200 McCormack Bridget BAS 5
JENNIFER BUCKLEY 200 McCormack Bridget BAS 4
JENNIFER BUCKLEY 200 McCormack Bridget BAS 5
JENNIFER BUCKLEY 200 McCormack Bridget BAS 4
JENNIFER BUCKLEY 200 McCormack Bridget LTAM 0.05
JENNIFER BUCKLEY 200 McCormack Bridget OT1 4
JENNIFER BUCKLEY 200 McCormack Bridget OT2 1
JENNIFER BUCKLEY 200 McCormack Bridget BAS 4
JENNIFER BUCKLEY 200 McCormack Bridget BAS 4
JENNIFER BUCKLEY 200 McCormack Bridget BAS 4

this bben a sample from the table. I want to be able to have the employee name, NUMBER AND SUPERVISOR there just once with the appropiate heading for what type of CODe they have BAS, OT1 as a heading with a count of the number of times they done that particular code

Where do i begin any help
 
You could create a query with something like :

SELECT TbSupervisor.[first name], TbSupervisor.[second name], TbSupervisor.code, TbSupervisor.Supervisor, Count(TbSupervisor.[second name]) AS [CountOfsecond name]
FROM TbSupervisor
GROUP BY TbSupervisor.[first name], TbSupervisor.[second name], TbSupervisor.code, TbSupervisor.Supervisor
HAVING (((TbSupervisor.code) Like "bas*"));

This will give you the total number of records where the code is BAS
Do the same for OT1, OT2 etc et voila.
 

Users who are viewing this thread

Back
Top Bottom