N
newbie123 via AccessMonster.com
Table 1 - Each record has the following fields:
1. EmpId
2. Dept
3. EmpName
4. MgrName
Table 2 - Each record has the following fields:
1. EmpId
2. Units Worked
3. Product Type
Is it possible to create the following tables in Access? If yes, then how?
Table1 has multiple/different EmpName for the same EmpID, and
different/multiple EmpID for the same EmpName. I would like to create a query:
Multiple Ids with Same Name
I am interested in the IDs only if they show up in Table 2.
****************
This is the code I used:
SELECT Table1.EMPNAME, Table1.EMPID, Table1.DEPT, Table1.MGRNAME
FROM Table1
WHERE (((Table1.EMPNAME) In (SELECT [EMPNAME] FROM [Table1] As Tmp GROUP BY
[EMPNAME] HAVING Count(*)>1 ))) and EMPID in (SELECT DISTINCT Table2.EMPID
FROM Table2)
ORDER BY Table1.EMPNAME;
HOWEVER, when putting in the previous I get the following error message:
You tried to execute a query that does not include the specified expression
'EmpName' as part of an aggregate function.
What does this mean?
1. EmpId
2. Dept
3. EmpName
4. MgrName
Table 2 - Each record has the following fields:
1. EmpId
2. Units Worked
3. Product Type
Is it possible to create the following tables in Access? If yes, then how?
Table1 has multiple/different EmpName for the same EmpID, and
different/multiple EmpID for the same EmpName. I would like to create a query:
Multiple Ids with Same Name
I am interested in the IDs only if they show up in Table 2.
****************
This is the code I used:
SELECT Table1.EMPNAME, Table1.EMPID, Table1.DEPT, Table1.MGRNAME
FROM Table1
WHERE (((Table1.EMPNAME) In (SELECT [EMPNAME] FROM [Table1] As Tmp GROUP BY
[EMPNAME] HAVING Count(*)>1 ))) and EMPID in (SELECT DISTINCT Table2.EMPID
FROM Table2)
ORDER BY Table1.EMPNAME;
HOWEVER, when putting in the previous I get the following error message:
You tried to execute a query that does not include the specified expression
'EmpName' as part of an aggregate function.
What does this mean?