Need some help and clarification.
I created an access query in design view. Now, I am trying to run the query using values from two linked tables.
I have selected the fields I need from both tables, I am using a Count function on one field and a sum function on another field but I am getting this error:
"You tried to execute a query that does not include the specified expression “EmployeeName” as part of an aggregate function"
How can I get this query to work?
Below is my SQL view:
Any input will be appreciated.Code:SELECT DISTINCT Count([PassNumber]) AS HeadCount, tblUnclaimed.EmployeeName FROM EmployeeInfo RIGHT JOIN tblUnclaimed ON (EmployeeInfo.L1 = tblUnclaimed.L1) AND (EmployeeInfo.Pass_Number = tblUnclaimed.PassNumber) WHERE (((tblUnclaimed.ReIssued_Check_Date) Between #3/1/2008# And #9/30/2008#) AND ((EmployeeInfo.Status) Like 'N*') AND ((EmployeeInfo.Union_Code) In ('00','01','32','33')) AND ((tblUnclaimed.Status) In ('E','U'))) OR (((tblUnclaimed.ReIssued_Check_Date) Between #3/1/2008# And #10/1/2008#) AND ((EmployeeInfo.Union_Code) In ('00','01','32','33')) AND ((tblUnclaimed.Status) In ('E','U')) AND ((Len([EmployeeInfo].[Status]))=1)) ORDER BY EmployeeInfo.L3, EmployeeInfo.L5;
Giftx.




Reply With Quote