DROP PROCEDURE IF EXISTS uspUpdateCOVIDFlag
GO

CREATE PROCEDURE uspUpdateCOVIDFlag
AS
BEGIN
  SET NOCOUNT ON;
  
  DECLARE @datum date = DATEADD(DAY, -14, GETDATE())
  
  UPDATE T_GONDVISELO
  SET
    C_ISCOVIDBEJELENTO = 'F'
  WHERE
    TOROLT = 'T' AND C_ISCOVIDBEJELENTO = 'T' AND C_COVIDBEJELENTESDATUMA < @datum

END
GO
