FITOMN of AM v3
5/11/2017 - 8:33 PM

BIT/IAM-1600 - Creación de SP para listar los limites de captura de calificación por plan de estudios y grupo obteniendo el nombre de evalua

BIT/IAM-1600 - Creación de SP para listar los limites de captura de calificación por plan de estudios y grupo obteniendo el nombre de evaluacion


----------------------------INICIO PROCEDIMIENTO ------------------------
IF OBJECT_ID('spListarLimitesCapturaCalByPlanGrupo', 'P') IS NOT NULL
      DROP PROC spListarLimitesCapturaCalByPlanGrupo 
GO

CREATE PROCEDURE spListarLimitesCapturaCalByPlanGrupo
	@idPlanEstudios INT,
	@iFolioGrupoClaseTentativo SMALLINT
/* --------------------------------------------------------------------------------------------------------------
	FECHA	   |    AUTOR		|	DESCRIPCION
 11/May/2017   | Luis Bernal	| 
--------------------------------------------------------------------------------------------------------------*/
AS 
BEGIN 
	SET NOCOUNT ON;

	SELECT clcc.iFolio, 
		   clcc.iFolioPeriodo, 
		   clcc.idPlantel, 
		   clcc.iGrado, 
		   clcc.dFecha, 
		   clcc.idEvaluacion, 
		   clcc.idPlanEstudios, 
		   clcc.dFechaPublicacion, 
		   clcc.dFechaInicialEval, 
		   clcc.dFechaFinalEval, 
		   clcc.dFechaInicioCaptura,
		   cfe.sAbreviatura AS sEvaluacion,
		   cfe2.sNombre AS sFormEvaluacion
	FROM   Ctrl_LimiteCapturaCal AS clcc 
		   INNER JOIN Ctrl_GrupoClaseTentativo AS cgct ON cgct.iFolioPeriodo = clcc.iFolioPeriodo 
		   INNER JOIN Ctrl_Grupos AS cg ON cg.idGrupo = cgct.idGrupo AND cg.idPlanEstudios = clcc.idPlanEstudios AND cg.idPlantel = clcc.idPlantel AND cg.iGrado = clcc.iGrado
		   INNER JOIN dbo.Ctrl_FormEvaluacion AS cfe ON cfe.idEvaluacion = clcc.idEvaluacion
		   INNER JOIN dbo.Cat_FormEvaluacion AS cfe2 ON cfe2.idFormEvaluacion = cfe.idFormEvaluacion
	WHERE  (clcc.idPlanEstudios = @idPlanEstudios) AND (cgct.iFolio = @iFolioGrupoClaseTentativo)
	ORDER BY clcc.dFechaFinalEval

END