DROP PROCEDURE  IF EXISTS uspGetTanitasiRendKivetelNapokEugyintezes 
GO

CREATE PROCEDURE uspGetTanitasiRendKivetelNapokEugyintezes
   @pIntezmenyId INT
  ,@pKezdete DATETIME
  ,@pVege DATETIME
AS
BEGIN
  SET NOCOUNT ON;

  SELECT Tanevrendje.C_DATUM Nap
    ,Tanevrendje.C_NAPTIPUSA TipusAzonosito
  FROM T_TANEVRENDJE_OSSZES Tanevrendje
  WHERE Tanevrendje.TOROLT = 'F'
    AND Tanevrendje.C_DATUM BETWEEN @pKezdete
      AND @pVege
    AND Tanevrendje.C_NAPTIPUSA < 100000
    AND Tanevrendje.C_INTEZMENYID = @pIntezmenyId
    AND Tanevrendje.C_OSSZESCSOPORTRAVONATKOZIK = 'T'
END
GO


