Ciao a tutti,
ho il seguente problema:
ho una query pivot che mi deve contare il numero delle chiamate che hanno lo stato = "NOT SERVED" e la durata delle chiamate inferiore a 30.
il codice è il seguente:
codice:
select detailDestinationName as 'Nome Coda',count(*) as 'Totale Chiamate ricevute',
count(case when status = 'SERVED' then uniqueId else null end) as 'Chiamate Servite',
(count(case when status = 'SERVED' then uniqueId else null end)/count(*)*100) as '% chiamate servite',
count(case when status = 'NOTSERVED' and conversationTime > 30 then uniqueId else null end) as 'Chiamate non Servite Superiori a 30 secondi'
from chiamate_report
group by detailDestinationId
Il problema è che la colonna 'Chiamate non servite inferiori a 30 secondi' mi fornisce sempre 0 come risultato
Potete aiutarmi?
Grazie