这是我的查询
Select
AgentActivityLog.StatusDateTime,
AgentActivityLog.UserId,
AgentActivityLog.StateDuration /60 AS Minutes,
AgentActivityLog.StatusKey
FROM UserWorkgroups
INNER JOIN AgentActivityLog ON UserWorkgroups.UserId = AgentActivityLog.UserId
WHERE
AgentActivityLog.StatusDateTime Between '08/01/2013' AND '08/02/2013' AND
StatusKey IN ('Shadow Trainer') AND
(UserWorkgroups.WorkGroup in ('LV_GR_9','LV_CCS_GENERAL','LV_PBX_INTERNAL'))
ORDER BY
AgentActivityLog.StatusDateTime,
AgentActivityLog.UserId,
AgentActivityLog.StatusKey,
AgentActivityLog.StateDuration
结果
2013-08-01 08:59:03.000 JMENDOZA1 13 Shadow Trainer
2013-08-01 09:13:50.000 JMENDOZA1 12 Shadow Trainer
我希望结果将当天的 StateDuration 相加,如下所示
2013-08-01 08:59:03.000 JMENDOZA1 25 Shadow Trainer.
感谢您的帮助。