Hey guys
Well I've been playing with various queries for a while, basically I'd like a unique count of some records within a table, below is test data.
EmpNum | FirstName
5 Bob
5 Bob
10 Harry
5 Bob
10 Harry
11 Ben
Result:
EmpNum | QtyCount
5 3
10 2
11 1
I read somewhere that that Access doesn't like distinct and count function within the same query, although the information was from 2001, therefore I don't know if it applies to do, here's one of my queries:
Advice appreciated.
Well I've been playing with various queries for a while, basically I'd like a unique count of some records within a table, below is test data.
EmpNum | FirstName
5 Bob
5 Bob
10 Harry
5 Bob
10 Harry
11 Ben
Result:
EmpNum | QtyCount
5 3
10 2
11 1
I read somewhere that that Access doesn't like distinct and count function within the same query, although the information was from 2001, therefore I don't know if it applies to do, here's one of my queries:
Code:
SELECT COUNT(DISTINCT [E.EmpNum]), E.FirstName, E.LastName, E.EMail
FROM TblEmployee AS E
INNER JOIN TblRsrcEmp AS RSE
ON E.EmpNum=RSE.EmpNum
WHERE (((RSE.Returned)='No'));
Advice appreciated.