Hi all.
I have a database of telephone system records.
I'm having a bit of trouble trying to come up with a SELECT statement for getting the count of incoming calls and the count of outgoing calls.
Basically, I want a report by Extension number, showing the average length of calls, number of incoming calls and number of outgoing calls. Incoming calls have "IN" in a field called "CalledNumber"
Something along the lines of:
This is where I'm stuck. How can I say "count of called number where callednumber = 'IN' AND called of called number where callednumber <> 'IN'
Thanks in advance
I have a database of telephone system records.
I'm having a bit of trouble trying to come up with a SELECT statement for getting the count of incoming calls and the count of outgoing calls.
Basically, I want a report by Extension number, showing the average length of calls, number of incoming calls and number of outgoing calls. Incoming calls have "IN" in a field called "CalledNumber"
Something along the lines of:
Code:
SELECT Extension, AVG(Duration), Count(CalledNumber)
This is where I'm stuck. How can I say "count of called number where callednumber = 'IN' AND called of called number where callednumber <> 'IN'
Thanks in advance