Files
dojo/public/home/cal/q3Event.q

24 lines
829 B
Plaintext
Raw Normal View History

2018-07-13 19:06:08 -05:00
select
date_format(evento.fecha_inicio,'%Y%m') as bid,
evento.id as eeid,
concat(lugar.municipio,", ",lugar.federativa) as ciudad,
concat(lugar.nombre,". ") as lugar,
lugar.direccion as dir,
case when month(evento.fecha_inicio) = month(evento.fecha_fin)
then concat("Del ", day(evento.fecha_inicio)," al ",day(evento.fecha_fin)," de ",mi.nombre)
else concat("Del ",day(evento.fecha_inicio)," de ",mi.nombre," al ",
day(evento.fecha_fin)," de ", mo.nombre)
end as fecha,
curso.nombre as nombre,
evento.imagen_chica as imagen_chica
from evento
inner join lugar on evento.lugar_id=lugar.id
inner join curso on evento.curso_id=curso.id
join mes as mi on mi.id=month(evento.fecha_inicio)
join mes as mo on mo.id=month(evento.fecha_fin)
where evento.estado=1
order by evento.fecha_inicio
;