Hi All,
I have a database of our company's mobile phone users. In it are several tables, one - tblEmployeeList a complete employee list with each employee's perpetual Project code and task code. a 2nd - tblJobList table with 2 columns for all the possible combinations of project code and task code, and a 3rd table - tblUser related to the Employee Listing of who the mobile phone users are. In this table is the opportunity to add an alternative project and task code for charging to a different budget.
Now, tblEmployeeList and tblJobList are updated weekly and the new data imported, which, if the user has not chosen an alternative budget, and uses their own one, that's fine - it'll be updated. However, if the user has previously chosen to select an alternative project and task code their combination could be illegal at a point in the future against the values given in tblJobList, and I need to run a query that will pull out these people.
I have tried the query:
SELECT tblEmployeeList.Name, tbluser.User, tblEmployeeList.[Home Job], tblEmployeeList.[Home Task]
FROM (tblEmployeeList INNER JOIN tbluser ON tblEmployeeList.[No] = tbluser.User) LEFT JOIN tblJobList ON (tblEmployeeList.[Home Task] = tblJobList.[Task Code]) AND (tblEmployeeList.[Home Job] = tblJobList.[No])
WHERE (((tblEmployeeList.[Home Job])<>[tblJobList].[No]) AND ((tblEmployeeList.[Home Task])<>[tblJobList].[Task Code]));
But when i hardcoded an illegal combination of project and task code into the fields in tbluser it was not pulled out, no rows are returned.
I hope someone can help.
Many Thanks
Graham
I have a database of our company's mobile phone users. In it are several tables, one - tblEmployeeList a complete employee list with each employee's perpetual Project code and task code. a 2nd - tblJobList table with 2 columns for all the possible combinations of project code and task code, and a 3rd table - tblUser related to the Employee Listing of who the mobile phone users are. In this table is the opportunity to add an alternative project and task code for charging to a different budget.
Now, tblEmployeeList and tblJobList are updated weekly and the new data imported, which, if the user has not chosen an alternative budget, and uses their own one, that's fine - it'll be updated. However, if the user has previously chosen to select an alternative project and task code their combination could be illegal at a point in the future against the values given in tblJobList, and I need to run a query that will pull out these people.
I have tried the query:
SELECT tblEmployeeList.Name, tbluser.User, tblEmployeeList.[Home Job], tblEmployeeList.[Home Task]
FROM (tblEmployeeList INNER JOIN tbluser ON tblEmployeeList.[No] = tbluser.User) LEFT JOIN tblJobList ON (tblEmployeeList.[Home Task] = tblJobList.[Task Code]) AND (tblEmployeeList.[Home Job] = tblJobList.[No])
WHERE (((tblEmployeeList.[Home Job])<>[tblJobList].[No]) AND ((tblEmployeeList.[Home Task])<>[tblJobList].[Task Code]));
But when i hardcoded an illegal combination of project and task code into the fields in tbluser it was not pulled out, no rows are returned.
I hope someone can help.
Many Thanks
Graham