﻿-- =============================================
-- Description: <Előszedjük a házi feladatokat a megadott paraméterek alapján>
-- =============================================
DROP PROCEDURE IF EXISTS uspGetHaziFeladatokByDateRange
GO

CREATE PROCEDURE uspGetHaziFeladatokByDateRange 
   @pIntezmenyId int
  ,@pTanevId int
  ,@pDatumTol datetime = NULL
  ,@pDatumIg datetime = NULL
AS BEGIN
  SET NOCOUNT ON;
  SELECT
     hf.ID AS ID
    ,hf.C_FELADASDATUMA AS FeladasDatuma
    ,hf.C_ORARENDIORAID AS OrarendiOraId
    ,hf.C_TANITASIORAID AS TanitasiOraId
  FROM T_HAZIFELADATOK hf
  WHERE hf.C_FELADASDATUMA BETWEEN @pDatumtol AND @pDatumig 
    AND hf.C_INTEZMENYID = @pIntezmenyId 
    AND hf.C_TANEVID = @pTanevId
END
GO
