09-17-2007 03:27 AM - edited 03-14-2019 11:34 PM
I need to do a sql query that shows me calls receveid for a dial number and were transfered from another dial number in a determinate date and time.
Can anybody help me?.
Solved! Go to Solution.
09-27-2007 12:16 PM
Here's my basic "everything to and from a given number" query. This is at least a starting point for you.
SELECT DATEADD([second], dateTimeOrigination - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Called_At, callingPartyNumber AS Extension,
originalCalledPartyNumber, finalCalledPartyNumber, DATEADD([second], dateTimeConnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102))
AS TimeConnect, DATEADD([second], dateTimeDisconnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Time_Disconnect, duration,
callingPartyNumberPartition, originalCalledPartyNumberPartition
FROM CallDetailRecord
WHERE (originalCalledPartyNumber = '12345678') OR
(callingPartyNumber = '12345678')
ORDER BY dateTimeOrigination DESC
09-17-2007 08:05 AM
If this call is transfered from another number you can find it by filtering on lastRedirectDn field.
--
regards,
pk
09-17-2007 11:35 PM
I think it is not a good answer for my knowledge building SQL queries.
Thanks.
09-27-2007 12:16 PM
Here's my basic "everything to and from a given number" query. This is at least a starting point for you.
SELECT DATEADD([second], dateTimeOrigination - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Called_At, callingPartyNumber AS Extension,
originalCalledPartyNumber, finalCalledPartyNumber, DATEADD([second], dateTimeConnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102))
AS TimeConnect, DATEADD([second], dateTimeDisconnect - 32400, CONVERT(DATETIME, '1970-01-01 00:00:00', 102)) AS Time_Disconnect, duration,
callingPartyNumberPartition, originalCalledPartyNumberPartition
FROM CallDetailRecord
WHERE (originalCalledPartyNumber = '12345678') OR
(callingPartyNumber = '12345678')
ORDER BY dateTimeOrigination DESC
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide