Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count cases outside SLA 1

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
HI,

I am trying to get this query to count all emails that were answered outside of SLA, the query should get the date to check from a form and then check all dates received for the date and then count how many have an AHT >720 or dateclosed is blank, but it doesnt work, can someone advise what is wrong. thanks

SELECT tblItemReceived.DateLogged, tblItemReceived.ITemAHT, tblItemReceived.DateClosed
FROM tblItemReceived
GROUP BY tblItemReceived.DateLogged, tblItemReceived.ITemAHT, tblItemReceived.DateClosed
HAVING (((tblItemReceived.DateLogged)=[Forms]![frmReporting]![txtfromdate]) AND ((tblItemReceived.ITemAHT)>720) AND ((tblItemReceived.DateClosed) Is Null Or (tblItemReceived.DateClosed)>[Forms]![frmReporting]![txtfromdate] Or ([tblItemReceived].[DateClosed])=""));


Hope this is of use, Rob.[yoda]
 
Perhaps this ?
SELECT DateLogged, Count(*) AS [# outside of SLA]
FROM tblItemReceived
WHERE DateLogged=[Forms]![frmReporting]![txtfromdate]
AND ITemAHT>720
AND (DateClosed Is Null Or DateClosed>DateLogged)
GROUP BY DateLogged;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thanks that worked great, also used to fine tune inside sla figures

Hope this is of use, Rob.[yoda]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top