Ver Mensaje Individual
  #5  
Antiguo 16-01-2009
jaimeh jaimeh is offline
Miembro
 
Registrado: mar 2007
Posts: 68
Reputación: 18
jaimeh Va por buen camino
Muchas gracias por la contestación me ha valido de mucho.

Lo de dark fallaba para una fecha que no tuviese una hora < 00:30:00.
No apareceria ningun resultado ni siquiera los de mas de 30 que tuviere.

Lo de Caro si funciona y lo he ampliado

<delphi>
' Select Distinct(t.Fecha), t1.d15, t2.d30, t3.d60, t4.Total ' +
' From Temporal4 t ' +

' Left Join (Select Fecha, Count(Fecha) as d15 From Temporal4 ' +
' Where Diferencia >= ' + '''00:00:00''' +
' and Diferencia < ' + '''00:15:00''' +
' group by Fecha) t1 on (t.Fecha=t1.Fecha) ' +

' Left Join (Select Fecha, Count(Fecha) as d30 From Temporal4 ' +
' Where Diferencia >= ' + '''00:15:00''' +
' and Diferencia < ' + '''00:30:00''' +
' Group By Fecha) t2 on (t.Fecha=t2.Fecha) ' +

' Left Join (Select Fecha, Count(Fecha) as d60 From Temporal4 ' +
' Where Diferencia >= ' + '''00:30:00''' +
' and Diferencia < ' + '''01:00:00''' +
' group by Fecha) t3 on (t.Fecha=t3.Fecha) ' +

' Left Join '+
' (select Fecha, Count(diferencia) as Total From Temporal4 ' +
' group by fecha) t4 on (t.Fecha=t4.Fecha) '

</delphi>


Me faltaría que la otra vez se me olvido los otros totales


dias----------<00:30:00---------<00:60:00--------total
-------------------------------------------------------

3/05/2008--------2---------------------------------2
5/05/2008--------1------------------1--------------2

total2-------------3------------------1--------------4



Muchas gracias a todos por ser tan amables.
Responder Con Cita