L
lynn atkinson
A couple of months ago I posted a question on how to filter a query with many
criteria. I did get a helpful answer, but I have got myself in another pickle
and cannot get the suggested code to work. In addition, I have simplified the
database by having fewer linked tables etc.
The scenario is this
I have a training database and I need to filter a query to find
qualified people. Whether a person is qualified or not depends on their job
title.
Job title = support assistant needs care2 AND starndard registration; OR
Advanced registration only
job title= support worker needs care3 AND standard registration; OR advanced
registration only
Job title=assistant project manager needs care3 AND standard registration
AND management3 OR Advanced registration AND management 3
I want to list all candidates who are, for example,
support workers who are qualified; all support assistants who are qualified
etc etc.
I have a table (progresstbl) which lists the the award (eg care 2, care3,
standard registration, advanced registration etc) and the
progress (eg completed, working towards etc). An employeeinfo table holds
information on the candidate like the name
I would like to produce 2 reports - one listing all the people completed
their qualifying awards and one listing all the peole compled AND those
working towards the qualifying awards.
If it helps, the following is the sql of something that nearly works but
doesnt have the combination of awards ie care 2 and standard registration
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], employeeinfo.[employee ID]
FROM employeeinfo INNER JOIN progress ON employeeinfo.[employee ID] =
progress.[employee id]
WHERE (((progress.status)="completed" Or (progress.status)="working
towards") AND ((progress.award)="care 2") AND
((employeeinfo.[post/role])="support assistant") AND ((employeeinfo.[old
contract])=False)) OR (((progress.status)="completed" Or
(progress.status)="working towards") AND ((progress.award)="care 3") AND
((employeeinfo.[post/role])="support worker") AND ((employeeinfo.[old
contract])=False)) OR (((progress.status)="completed" Or
(progress.status)="working towards") AND ((progress.award)="care 3" And
(progress.award)="management 3") AND ((employeeinfo.[post/role])="assistant
project manager") AND ((employeeinfo.[old contract])=False));
criteria. I did get a helpful answer, but I have got myself in another pickle
and cannot get the suggested code to work. In addition, I have simplified the
database by having fewer linked tables etc.
The scenario is this
I have a training database and I need to filter a query to find
qualified people. Whether a person is qualified or not depends on their job
title.
Job title = support assistant needs care2 AND starndard registration; OR
Advanced registration only
job title= support worker needs care3 AND standard registration; OR advanced
registration only
Job title=assistant project manager needs care3 AND standard registration
AND management3 OR Advanced registration AND management 3
I want to list all candidates who are, for example,
support workers who are qualified; all support assistants who are qualified
etc etc.
I have a table (progresstbl) which lists the the award (eg care 2, care3,
standard registration, advanced registration etc) and the
progress (eg completed, working towards etc). An employeeinfo table holds
information on the candidate like the name
I would like to produce 2 reports - one listing all the people completed
their qualifying awards and one listing all the peole compled AND those
working towards the qualifying awards.
If it helps, the following is the sql of something that nearly works but
doesnt have the combination of awards ie care 2 and standard registration
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], employeeinfo.[employee ID]
FROM employeeinfo INNER JOIN progress ON employeeinfo.[employee ID] =
progress.[employee id]
WHERE (((progress.status)="completed" Or (progress.status)="working
towards") AND ((progress.award)="care 2") AND
((employeeinfo.[post/role])="support assistant") AND ((employeeinfo.[old
contract])=False)) OR (((progress.status)="completed" Or
(progress.status)="working towards") AND ((progress.award)="care 3") AND
((employeeinfo.[post/role])="support worker") AND ((employeeinfo.[old
contract])=False)) OR (((progress.status)="completed" Or
(progress.status)="working towards") AND ((progress.award)="care 3" And
(progress.award)="management 3") AND ((employeeinfo.[post/role])="assistant
project manager") AND ((employeeinfo.[old contract])=False));