Ver Mensaje Individual
  #13 (permalink)  
Antiguo 15/05/2009, 18:29
Avatar de death_nemesis
death_nemesis
 
Fecha de Ingreso: abril-2009
Ubicación: Santiago - Chile
Mensajes: 147
Antigüedad: 15 años, 10 meses
Puntos: 2
Respuesta: Problema Con con funcion Date

sale igual que denante :( , Dradi7
Cuenta pero no ordena las fechas
Cita:

SELECT sum(cli_num)AS 'Total_Clientes',Cast(Year(cli_fec)AS Varchar)+' '+DateName(Month,Cli_fec)+' '+Cast(day(cli_fec)AS Varchar)AS 'Fecha' FROM cliente GROUP BY Cast(Year(cli_fec)AS Varchar)+' '+DateName(Month,Cli_fec)+' '+Cast(day(cli_fec)AS Varchar)ORDER BY Cast(Year(cli_fec)AS Varchar)+' '+DateName(Month,Cli_fec)+' '+Cast(day(cli_fec)AS Varchar)

-----Total_Clientes-------->Fecha

1----------------------->2009 Abril 16
1----------------------->2009 Agosto 16
1----------------------->2009 Diciembre 16
1----------------------->2009 Enero 16
1----------------------->2009 Febrero 16
2----------------------->2009 Julio 15
2----------------------->2009 Junio 15
1----------------------->2009 Marzo 16
2----------------------->2009 Mayo 14
1----------------------->2009 Mayo 15
1----------------------->2009 Noviembre 16
1----------------------->2009 Octubre 16
1----------------------->2009 Septiembre 16