Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/09/2011, 14:42
vmoran2009
 
Fecha de Ingreso: febrero-2011
Mensajes: 43
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: ¿como mostrar nombres de meses y no el numero?

SELECT CASE month(fecha_ingreso) when '01' then 'Enero'
when '02' then 'Febrero'
when '03' then 'Marzo'
when '04' then 'Abril'
when '05' then 'Mayo'
when '06' then 'Junio'
when '07' then 'Julio'
when '08' then 'Agosto'
when '09' then 'Septiembre'
when '10' then 'Octubre'
when '11' then 'Noviembre'
when '12' then 'Diciembre'
END as meses,sum(estado) as valores
FROM movimientos
WHERE estado=1 and year(fecha_ingreso)=year(now())
GROUP BY month(fecha_ingreso