Can somebody please enlighten me on how I will get the total calls offered per agent per day using the Termination Call Detail Table. I was able to use the Variable1 as Line then look for the concerned variable. The result however is always different from CUIC, I don't know if I should really be comparing them.
SELECT Date, SUM(Offered) AS OFFERED
CAST(DateTime as Date) AS Date
, Variable1 AS Line
, Offered = 1
WHERE Variable1 LIKE '%US_BUF_TS%' AND Variable1 LIKE '%_Q'
AND DATEDIFF(month,DateTime,GETDATE()) = 1
GROUP BY Date
ORDER BY Date
This is the code we run in SQL server. This runs OK but the result per day is never the same in cuic. Some days are off by 1, some are off by a hundred. Also how do I get a line by line report for agent. This is currently grouped by date.
Please let me know if I am missing something here or if there a more correct approach to this.
Thanks very much for your help.
I notice you are using GETDATE. Please check if the dates are saved in UTC. You could be having a time zone difference.
For example, you could use GETUTCDATE(). Then, you'll have to worry about the conversion between your time zone, and the time zone of were the data was saved.
Please sign in to leave a comment.