M
Michael Rossi
I am trying to write what seems to be a relatively simple query in Access but
I am having problems with it and cannot find a solution anywhere. I even
asked the head of our IT dept who is quite proficient with Access and he was
stumped as well. Here is the background:
I have 2 tables. One table is called 'Associates' and holds the names, ID
numbers, hire date, and shift # of people in the company. The other is
called [Process Audits All] and keeps track of the employees that have been
audited. What the query is supposed to do is just give me a list of the
associates in the company who have NOT yet been audited. The idea is to have
every associate audited within 60 days of their hire date. The code I wrote
is as follows:
SELECT Associates.EmpNum, Associates.Name, Associates.[Hire Date]+60 AS
[Audit By]
FROM Associates
WHERE associates.EmpNum not in (select distinct [process audits
all].AuditeeIDNum from [process audits all]);
The result of this is no data.
For some reason, when I use "In" instead of "Not In", I get the opposite of
what I'm looking for (meaning I get the list of associates who HAVE been
audited). This leaves me to believe that there is something specific to the
"Not In" clause. I even tried to do an inner join but that didn't seem to
work either. If someone can please help me out with this I would greatly
appreciate it.
Thank you,
Michael Rossi
I am having problems with it and cannot find a solution anywhere. I even
asked the head of our IT dept who is quite proficient with Access and he was
stumped as well. Here is the background:
I have 2 tables. One table is called 'Associates' and holds the names, ID
numbers, hire date, and shift # of people in the company. The other is
called [Process Audits All] and keeps track of the employees that have been
audited. What the query is supposed to do is just give me a list of the
associates in the company who have NOT yet been audited. The idea is to have
every associate audited within 60 days of their hire date. The code I wrote
is as follows:
SELECT Associates.EmpNum, Associates.Name, Associates.[Hire Date]+60 AS
[Audit By]
FROM Associates
WHERE associates.EmpNum not in (select distinct [process audits
all].AuditeeIDNum from [process audits all]);
The result of this is no data.
For some reason, when I use "In" instead of "Not In", I get the opposite of
what I'm looking for (meaning I get the list of associates who HAVE been
audited). This leaves me to believe that there is something specific to the
"Not In" clause. I even tried to do an inner join but that didn't seem to
work either. If someone can please help me out with this I would greatly
appreciate it.
Thank you,
Michael Rossi