SELECT DISTINCTROW Accounts.Rate, Cases.[Start Time], Cases.Resolution, Round(Sum(DateDiff("n",[Start Time],[End Time])/60),2) AS CaseTime, -1*[Rate]*[CaseTime] AS CaseCost, Accounts.Company
FROM [Account Credits] INNER JOIN (Accounts INNER JOIN Cases ON Accounts.ID=Cases.Customer) ON [Account Credits].Account=Accounts.ID
GROUP BY Accounts.Rate, Cases.[Start Time], Cases.Resolution, Accounts.Company, Accounts.Company
HAVING (((Accounts.Company)=[?]))
ORDER BY Accounts.Company;
|