G
Guest
Not sure if posts buried far down in threads started yesterday are picked up
as new, so I am going to start another one - Tell me if this is wrong
procedure.
Anyway further to my post yesterday with the count unique subject, I am
close to getting what I want, but still not there.
A brief resume of my question
I need to count how many people are qualified. However some may have more
than one award, but I just want count them once regardless of how many awards
they have.
Here is the sql of the original query which I have based a report on,
however, I cannot get it to count the employee ID only once. This is where
the select distinct should come in, but where
SELECT progress.status, progress.[candidate ID], progress.[start date],
progress.award, employeeinfo.surname, employeeinfo.forename,
employeeinfo.title, employeeinfo.[post/role], employeeinfo.Project,
employeeinfo.locality, employeeinfo.[old contract],
Count(employeeinfo.[employee ID]) AS [CountOfemployee ID]
FROM employeeinfo INNER JOIN progress ON employeeinfo.[employee ID] =
progress.[employee id]
GROUP BY progress.status, progress.[candidate ID], progress.[start date],
progress.award, employeeinfo.surname, employeeinfo.forename,
employeeinfo.title, employeeinfo.[post/role], employeeinfo.Project,
employeeinfo.locality, employeeinfo.[old contract]
HAVING (((progress.status)="completed") AND ((progress.award)="care 4") AND
((employeeinfo.[post/role])="locality manager" Or
(employeeinfo.[post/role])="project manager") AND ((employeeinfo.[old
contract])=False)) OR (((progress.status)="completed") AND
((progress.award)="management 4") AND ((employeeinfo.[post/role])="locality
manager" Or (employeeinfo.[post/role])="project manager") AND
((employeeinfo.[old contract])=False));
iI need to put in the select distinct query - after the count bit? Do I
replace the FROM statement as it stands?
the select distinct query is
SELECT DISTINCT progress.[employee id]
FROM progress
WHERE (((progress.status)="completed") AND ((progress.award)="care 4")) OR
(((progress.status)="completed") AND ((progress.award)="management 4"));
I have obviously put it in the wrong place because I am now getting a
message about the LEVEL reserved word etc.....
Can I have 2 FROM statements or do I replace the FROM in the existing query?
Cheers
as new, so I am going to start another one - Tell me if this is wrong
procedure.
Anyway further to my post yesterday with the count unique subject, I am
close to getting what I want, but still not there.
A brief resume of my question
I need to count how many people are qualified. However some may have more
than one award, but I just want count them once regardless of how many awards
they have.
Here is the sql of the original query which I have based a report on,
however, I cannot get it to count the employee ID only once. This is where
the select distinct should come in, but where
SELECT progress.status, progress.[candidate ID], progress.[start date],
progress.award, employeeinfo.surname, employeeinfo.forename,
employeeinfo.title, employeeinfo.[post/role], employeeinfo.Project,
employeeinfo.locality, employeeinfo.[old contract],
Count(employeeinfo.[employee ID]) AS [CountOfemployee ID]
FROM employeeinfo INNER JOIN progress ON employeeinfo.[employee ID] =
progress.[employee id]
GROUP BY progress.status, progress.[candidate ID], progress.[start date],
progress.award, employeeinfo.surname, employeeinfo.forename,
employeeinfo.title, employeeinfo.[post/role], employeeinfo.Project,
employeeinfo.locality, employeeinfo.[old contract]
HAVING (((progress.status)="completed") AND ((progress.award)="care 4") AND
((employeeinfo.[post/role])="locality manager" Or
(employeeinfo.[post/role])="project manager") AND ((employeeinfo.[old
contract])=False)) OR (((progress.status)="completed") AND
((progress.award)="management 4") AND ((employeeinfo.[post/role])="locality
manager" Or (employeeinfo.[post/role])="project manager") AND
((employeeinfo.[old contract])=False));
iI need to put in the select distinct query - after the count bit? Do I
replace the FROM statement as it stands?
the select distinct query is
SELECT DISTINCT progress.[employee id]
FROM progress
WHERE (((progress.status)="completed") AND ((progress.award)="care 4")) OR
(((progress.status)="completed") AND ((progress.award)="management 4"));
I have obviously put it in the wrong place because I am now getting a
message about the LEVEL reserved word etc.....
Can I have 2 FROM statements or do I replace the FROM in the existing query?
Cheers