dharkangel
MIS
Hi everyone,
I have a query that almost works but I don't know how to do one final part. I need to pull the [Assigned To] field and match each Distinct [Assigned To] entry with its proper 'Role' which is found in the 'UserRoleData' table. So I need the output to look like this:
Assigned To: Role:
Smith, Jones EUM
Darvey, Tom EUM
Peters, Bob DIR
etc...
the 'UserRoleData' table has each employee and their respective role like this:
Resource Name Role
Smith, Jones EUM
Darvey, Tom EUM
Peters, Bob DIR
The problem is that the QPTActions table contains all tasks assigned to any user. So it will be a many to one relationship. It does not include their role which is why I have to use the 'UserRoleData' to find the Role. This is how the 'QPTActions' table looks:
Assigned To
Smith, Jones
Smith, Jones
Darvey, Tom
Darvey, Tom
Darvey, Tom
Peters, Bot
Here is my query I am building:
SELECT DISTINCT (QPTActions.[Assigned To]) AS Assignee, UserRoleData.Role
FROM QPTActions, UserRoleData
WHERE DateValue(QPTActions.[Entry Date])<=DateValue('1/2/2006') And DateValue(QPTActions.[Close Date])>DateValue('1/2/2006');
I have a query that almost works but I don't know how to do one final part. I need to pull the [Assigned To] field and match each Distinct [Assigned To] entry with its proper 'Role' which is found in the 'UserRoleData' table. So I need the output to look like this:
Assigned To: Role:
Smith, Jones EUM
Darvey, Tom EUM
Peters, Bob DIR
etc...
the 'UserRoleData' table has each employee and their respective role like this:
Resource Name Role
Smith, Jones EUM
Darvey, Tom EUM
Peters, Bob DIR
The problem is that the QPTActions table contains all tasks assigned to any user. So it will be a many to one relationship. It does not include their role which is why I have to use the 'UserRoleData' to find the Role. This is how the 'QPTActions' table looks:
Assigned To
Smith, Jones
Smith, Jones
Darvey, Tom
Darvey, Tom
Darvey, Tom
Peters, Bot
Here is my query I am building:
SELECT DISTINCT (QPTActions.[Assigned To]) AS Assignee, UserRoleData.Role
FROM QPTActions, UserRoleData
WHERE DateValue(QPTActions.[Entry Date])<=DateValue('1/2/2006') And DateValue(QPTActions.[Close Date])>DateValue('1/2/2006');