Consulta de count

19/07/2005 - 15:40 por Andromeda | Informe spam
Buen Día,

por favor quisiera saber como se puede obtener el nombre del operador con
respecto al monto total, ya que al añadirle as T1, el mismo no genera el
nombre del operador


ejemplo:

select max(total)as total1 from(select oper_cerrar,count(*) as total from
qctkclie where dfecha_fin between '" & txtfecha_ini.text & "' and '" &
txtfecha_fin.text & "' group by oper_cerrar ) as t1

Muchas gracias...
 

Leer las respuestas

#1 Manuel Vera
19/07/2005 - 15:51 | Informe spam
Asumiendo que el "nombre del operador" es oper_cerrar puedes hacer esto:

select max(total) as total1 ,
t1.oper_cerrar
from (select oper_cerrar, count(*) as total
from qctkclie
where dfecha_fin between '" & txtfecha_ini.text &
"' and '" & txtfecha_fin.text & "'
group by oper_cerrar ) as t1

Salu2
MV


"Andromeda" wrote in message
news:
Buen Día,

por favor quisiera saber como se puede obtener el nombre del operador con
respecto al monto total, ya que al añadirle as T1, el mismo no genera el
nombre del operador


ejemplo:

select max(total)as total1 from(select oper_cerrar,count(*) as total from
qctkclie where dfecha_fin between '" & txtfecha_ini.text & "' and '" &
txtfecha_fin.text & "' group by oper_cerrar ) as t1

Muchas gracias...


Preguntas similares