G
Guest
Sorry for the subject description, I hope I can better explain my question
here.
I have a access 2003 database with related tables. What I am trying to do
is query for records that do not contain a record type in a related table.
Example:
Main table is jobs
Related table is tasks
There are many tasks related to any job (one to many relationship).
The linked field type in a number type.
I want to query for jobs that DO NOT have a specific task type.
I have a query like this:
"
SELECT DISTINCTROW Jobs.JobID, Jobs.JobNr, Jobs.RevisedInstallDate,
Jobs.JobName
FROM Jobs INNER JOIN JobTasks ON Jobs.JobID = JobTasks.JobID
WHERE (((Jobs.JobNr) Not Like "00/00000") AND ((Jobs.JobName) Not Like "Shop
Maintenance & Organization") AND ((JobTasks.TaskID) Not Like 2) AND
((Jobs.CompletedProduction)=False) AND ((Jobs.CompletedService)=False))
ORDER BY Jobs.RevisedInstallDate, Jobs.JobName;
"
However it still includes the task type 2 in some circumstances.
Any ideas?
Thanks,
John
here.
I have a access 2003 database with related tables. What I am trying to do
is query for records that do not contain a record type in a related table.
Example:
Main table is jobs
Related table is tasks
There are many tasks related to any job (one to many relationship).
The linked field type in a number type.
I want to query for jobs that DO NOT have a specific task type.
I have a query like this:
"
SELECT DISTINCTROW Jobs.JobID, Jobs.JobNr, Jobs.RevisedInstallDate,
Jobs.JobName
FROM Jobs INNER JOIN JobTasks ON Jobs.JobID = JobTasks.JobID
WHERE (((Jobs.JobNr) Not Like "00/00000") AND ((Jobs.JobName) Not Like "Shop
Maintenance & Organization") AND ((JobTasks.TaskID) Not Like 2) AND
((Jobs.CompletedProduction)=False) AND ((Jobs.CompletedService)=False))
ORDER BY Jobs.RevisedInstallDate, Jobs.JobName;
"
However it still includes the task type 2 in some circumstances.
Any ideas?
Thanks,
John