mande???
Código SQL:
Ver originalCREATE PROCEDURE fechas (@a_ini INT, @m_ini INT INT, @a_fin INT, @mes_fin INT)
AS
SELECT b.cod_trabajador,b.cod_concepasist,a.ano,a.mes,a.semana,b.cantidad AS horas
FROM rh_planilla_mensual_cabecera a, rh_registro_horas b
WHERE a.tip_planilla='E' AND a.cod_clase_planilla='01' AND a.flg_status_planilla='L' AND
((a.ano=@a_ini AND a.mes >= @m_inic) OR (a.ano=@a_fin AND a.mes <= @mes_fin)) AND
a.tip_planilla=b.tip_planilla AND a.num_corre_planilla=b.num_corre_planilla AND b.cod_concepasist IN ('AS01','HE01','HE02','HE03')
ORDER BY b.cod_trabajador,a.ano,a.mes,a.semana,b.cod_concepasist
EXEC fechas 2013,9,2014,3
Y ahi lo tienes, pero....te faltan parametros??? eso lo veremos en el siguiente post :P