Exclude Specific Criteria From Queries

G

Guest

Hi There,

I am extracting data from an external database and I want to exclude certain
records if a field has specific values
To put it simply: If an employee has an "Employee Type" = "A" OR "B", then I
do not want the query to bring back the employee records of those "employee
types".
Employees can have multiple "employee types" associated with them. If they
have any other "employee type", it should bring back their name.

I have tried various ways, but it only seems to exclude entries that have
only 1 of the criteria. If an employee has both entries "A" and "B", it still
brings back the employee name.

Can anyone hlep or have any suggestions?

Many Thanks,
 
M

Marshall Barton

Lucy said:
I am extracting data from an external database and I want to exclude certain
records if a field has specific values
To put it simply: If an employee has an "Employee Type" = "A" OR "B", then I
do not want the query to bring back the employee records of those "employee
types".
Employees can have multiple "employee types" associated with them. If they
have any other "employee type", it should bring back their name.

I have tried various ways, but it only seems to exclude entries that have
only 1 of the criteria. If an employee has both entries "A" and "B", it still
brings back the employee name.


It sure would have helped if you had explained exactly what
the employee type field contains. I will take a guess that
the field contains text that is a string of letters that
look like "A" or "ABC" or "CD" or . . .

If that's the case, then use a query that looks like:
SELECT EType, EName, . . .
FROM thetable
WHERE Not (EType Like "*A*" Or EType Like "*B*")
 

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