Hello
I'm Looking for some solution to my Problem
I have Crosstab Query
TRANSFORM Count(qrySickCount.TYPE) AS CountOfTYPE
SELECT qrySickCount.FullName, Count(qrySickCount.TYPE) AS TOTAL
FROM qrySickCount
WHERE (((qrySickCount.Exception)=False))
GROUP BY qrySickCount.FullName, qrySickCount.Exception
PIVOT Format([StartDate],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
Base on other Query
SELECT [FirstName] & " " & [LastName] AS FullName, tblLeave.StartDate, tblLeave.EndDate, DateDiff("d",[StartDate],[EndDate]) AS DaysOff, IIf([ReasonType]=4,"HOL",IIf([ReasonType]=5,"HOL",IIf([ReasonType]=1,"SICK",IIf([ReasonType]=2,"SICK",IIf([ReasonType]=3,"SICK"))))) AS TYPE, tblLeave.Exception
FROM tblEmployee INNER JOIN (tblReasonType INNER JOIN tblLeave ON tblReasonType.ID = tblLeave.ReasonType) ON tblEmployee.EmployeeNR = tblLeave.EmployeeNr
GROUP BY [FirstName] & " " & [LastName], tblLeave.StartDate, tblLeave.EndDate, DateDiff("d",[StartDate],[EndDate]), IIf([ReasonType]=4,"HOL",IIf([ReasonType]=5,"HOL",IIf([ReasonType]=1,"SICK",IIf([ReasonType]=2,"SICK",IIf([ReasonType]=3,"SICK"))))), tblLeave.Exception
HAVING (((IIf([ReasonType]=4,"HOL",IIf([ReasonType]=5,"HOL",IIf([ReasonType]=1,"SICK",IIf([ReasonType]=2,"SICK",IIf([ReasonType]=3,"SICK"))))))="SICK") AND ((tblLeave.Exception)=False));
And I'm Looking to see only people who have more then 3 SICK in Total only
When i place Criteria to my TOTAL column I reciving an error
"cannot have aggregate function in where clause"
its any way to pass that ??
or how to build a query what will show me peaple who have more then 3 SICK in a Year Base on my secund one ????
Thanks in Advance