Query Error on Aggregate

mhark

New member
Local time
Today, 05:21
Joined
Jun 18, 2008
Messages
2
All,
when I run the following code in my query I get the below error, any ideas?

SQL Code

SELECT AttendancebyDate.Date, AttendancebyDate.EmployeeID, AttendancebyDate.Duration, [Time&LaborArchive].OccuranceNeeded, [Time&LaborArchive].OccuranceAcknoledged

FROM ([Time&LaborArchive] INNER JOIN [EmployeeTime&LaborName] ON [Time&LaborArchive].Name = [EmployeeTime&LaborName].IdleName) INNER JOIN AttendancebyDate ON [EmployeeTime&LaborName].EmployeeID = AttendancebyDate.EmployeeID

GROUP BY AttendancebyDate.Date, AttendancebyDate.EmployeeID, AttendancebyDate.Duration, [Time&LaborArchive].OccuranceNeeded, [Time&LaborArchive].OccuranceAcknoledged

HAVING ((([Time&LaborArchive].OccuranceNeeded)=IIf([Duration]>7,True,False)));



Error
You tried to execute a query that does not include the specified expression '[Time&LaborArchive].OccuranceNeeded)=IIf([Duration]>7,True,False' as part of an aggregate function
 
Last edited:
You have to add a group by or aggregate function for the above mentioned field as well
 
Got it. Thanks
 

Users who are viewing this thread

Back
Top Bottom