Re: help with SQL
Posted in 2000
This worked wonderful... Thanks for the help
Jeff
"Rudy Fernandes" <rferdy@americasm01.nt.com> wrote in message
news:3980213D.88DC1F71@americasm01.nt.com...
> Try this :
>
>
> SELECT dest_country AS Country,
> SUM(CASE
> WHEN outbound_duration > 0 THEN 1
> ELSE 0
> END) AS Attempts,
> SUM(CASE
> WHEN answered_duration > 0 THEN 1
> ELSE 0
> END) AS Calls
> FROM master_call
> WHERE out_trunk_group=18
> AND call_date_time_k BETWEEN '2000-07-25 00:00:00' AND '2000-07-2623:59:59'
> GROUP BY dest_country;
>
>
>
> Rudy
>
>
> Jeff Bluemel wrote:
>
> > SELECT dest_country AS Country,
> > (SELECT COUNT(outbound_duration)
> > FROM master_call
> > WHERE outbound_duration != 0
> > AND call_date_time_k BETWEEN '2000-07-25 00:00:00' AND'2000-07-26
> > 23:59:59'
> > AS Attempts,
> > ...
> > FROM master_call
> > WHERE out_trunk_group=18
> > AND call_date_time_k BETWEEN '2000-07-25 00:00:00' AND '2000-07-26
> > 23:59:59'
> > GROUP BY dest_country;
> >
> > This is the output that I received;
> >
> > country attempts callspts
> >
> > 46 31806 14664
> > 62 31806 14664
> > ...
> > 671 31806 14664
> >
> > How can I modify this so the it calculates the calls and attempts by my
> > other group by and selected information? There will be several other
things
> > that I add to this.
> > Jeff
>