General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>>Hi all
>>>I have a table that contains all incoming and out going calls,
>>>with the Following fileds call_date , call_time phoneline and duration of each call,
>>>What I need to know is if it ever happen that all lines where busy at the same time and if yes for how long,
>>>Thank You
>>
>>The algorithm, I think, would be something like this:
>>
>>Convert each record to two: one with start_date_time, one with end_date_time. Go through the result in chronological (date_time) order. Start with zero. Add one for each time a call starts, subtract one for each time a call finishes. Alarm when your count = MAX_COUNT (the number of available phone lines).
>>
>>HTH, Hilmar.
>
>Hi Hilmar,
>
>Good idea, but most of the systems I interface with don't report on the call until it is completed. Notice his 'duration' field ? Your alarm won't work in this case. Realtime, that is. I'm trying it with some historical data... :>)
Ugh. Well, I got something working, but it showed me how bad my data really was. In my case, the callstart time is to the minute, while the duration is to the second. This gave me a bunch of false 'hits', around 190 out of 11,000+ records.
With good data, your idea works fine. Thanks for getting me thinking. :>)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only