Quantcast
Viewing latest article 1
Browse Latest Browse All 5

contar registros

Y SI LE AGREGAS UN TOP 1

select count(agent) as agente,datepart(hour,convert(varchar,start_time,8))as hora 
from easy..ag_in_cp_log 
where campaign='64' 
and convert(varchar(10),start_time,103)='04/05/2013' 
and datepart(hour,convert(varchar,start_time,8))='4' 
group by agent,datepart(hour,convert(varchar,start_time,8))

select TOP 1 count(agent) as agente,datepart(hour,convert(varchar,start_time,8))as hora 
from easy..ag_in_cp_log 
where campaign='64' 
and convert(varchar(10),start_time,103)='04/05/2013' 
and datepart(hour,convert(varchar,start_time,8))='4' 
group by agent,datepart(hour,convert(varchar,start_time,8))
prueba y nos cuentas


juanca


Viewing latest article 1
Browse Latest Browse All 5