Its giving me an error Cannot have aggreate function in Where
clause(tblMain.[DAYS DATE] Between [Enter Week Begining: (mm/dd/yy)] And
[Enter Week Ending: (mm/dd/yy)] And Sum([EMPLOYEE TIME])="Chad Zablackas"
And
Sum([EMPLOYEE TIME])="Lenny Lamatrice" And Sum([EMPLOYEE TIME])="Jim
Balvin"). Here is the SQL.
SELECT tblMain.FOOTAGE, tblMain.[Product Description], tblMain.Supervisor,
tblMain.Shift, tblMain.[EMPLOYEE NAME], tblMain.[DT REGULAR],
tblMain.[Machine Ran], tblMain.[Total Footage], tblMain.[DAYS DATE],
tblMain.[EMPLOYEE TIME], ([DT REGULAR])/([EMPLOYEE TIME]-[DT Reason 1]-[DT
MAINTENANCE]-[DT Reason 2]) AS [Delay Percent], tblMain.[DT Reason 1],
tblMain.[DT Reason 01], tblMain.[DT Reason 2], tblMain.[DT Reason 02],
tblMain.[DT MAINTENANCE], Sum([EMPLOYEE TIME]) AS [Chad Zablackas],
Sum([EMPLOYEE TIME]) AS [Lenny Lamatrice], Sum([EMPLOYEE TIME]) AS [Jim
Balvin]
FROM tblMain
WHERE (((tblMain.[DAYS DATE]) Between [Enter Week Beginning: (mm/dd/yy)]
And
[Enter Week Ending: (mm/dd/yy)]) AND ((Sum([EMPLOYEE TIME]))="Chad
Zablackas") AND ((Sum([EMPLOYEE TIME]))="Lenny Lamatrice") AND
((Sum([EMPLOYEE TIME]))="Jim Balvin"))
ORDER BY tblMain.Shift;
Ken Snell (MVP) said:
Field: Bill Black: Sum([EMPLOYEE TIME])
Criteria: "Bill Black"
--
Ken Snell
<MS ACCESS MVP>
Not quite sure I understand what you mean. Can I do it this way? But it
asks
for the SumOfEMPLOYEE TIME when I run the query? I have to do this for
3
supervisors..Thanks!
Field: Bill Black: [SumOfEMPLOYEE TIME]
Criteria: "Bill Black"
:
SELECT EmployeeName, Sum([EMPLOYEE TIME]) AS TotalEmpTime
FROM TableName
WHERE EmployeeName = 'Bill Black'
GROUP BY EmployeeName;
--
Ken Snell
<MS ACCESS MVP>
Hello, I have a query that I want to have an expression and I wnat
to
use
it
on a RPT but everytime I write it it asks the expression after it
asks
for
my
date range. I want to sum EMPLOYEE TIME for a perticular supervisor
say
Bill
Black. How would I write this in the query as an expression and the
criteria
being Bill Black?
Thanks!