我正在尝试建立一些报告。我有这个查询:
SELECT Agente.UserUri as Agente, COUNT(Agente.UserUri) as NumeroRisposte
FROM Users as User1, Users as User2, Users as StartedByUser, Users as Agente,
Phones as FromPhone, Phones as ConnectedPhone,
SessionDetails as IVRSession, SessionDetails as AgenteSession,
VoipDetails,
ClientVersions as Client1Version, ClientVersions as Client2Version
WHERE VoipDetails.SessionIdTime = IVRSession.SessionIdTime AND
VoipDetails.SessionIdSeq = IVRSession.SessionIdSeq AND
VoipDetails.FromNumberId = FromPhone.PhoneId AND
VoipDetails.FromNumberId = ConnectedPhone.PhoneId AND
IVRSession.SessionIdTime = AgenteSession.ReplacesDialogIdTime AND
IVRSession.SessionIdSeq = AgenteSession.ReplacesDialogIdSeq AND
Agente.UserId = AgenteSession.User1Id AND
User1.UserId = IVRSession.User1Id AND
User2.UserId = IVRSession.User2Id AND
StartedByUser.UserId = IVRSession.SessionStartedById AND
Client1Version.VersionId = IVRSession.User1ClientVerId AND
Client2Version.VersionId = IVRSession.User2ClientVerId AND
(Client1Version.ClientType = 1024 or Client2Version.ClientType = 1024) AND
User2.UserUri = 'ivr0679071new' AND
IVRSession.InviteTime BETWEEN '18/02/2014 16:28:19' AND '19/02/2014 16:28:19'
GROUP BY Agente.UserUri
ORDER BY Agente.UserUri
不要试图理解查询。
我只想知道如何使用报告参数在 BETWEEN 条件中使用它们来过滤查询。
这是可能的?