Ver Mensaje Individual
  #4  
Antiguo 19-08-2008
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.557
Reputación: 25
egostar Va camino a la fama
Ok, ya entendí

Yo haría esto:

Código Delphi [-]
SQL.Add('select direccion, count (ID) as total, COUNT(FECHA1) AS F1, COUNT(FECHA2) AS F2, COUNT(FECHA3) AS F3, COUNT(OTRASADMONS) AS OTRAS,
 (count(FECHA1)+count(FECHA2)+count(FECHA3)) as TOTAL from tbl_bienes group by direccion');

También omitiría el Order by ya que al hacer un Group by automáticamente lo ordena.

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita