SELECT
 T_Formation.Intitule as Col1,
  'Du ' + CONVERT(VARCHAR(12),T_Formation.DateDebutSession,113) + ' au ' + CONVERT(VARCHAR(12),T_Formation.DateFinSession,113) + ' (' + T_PARFOR_ETA.CodeEtape + ')' as Col2
FROM
  T_FORMATION
  LEFT OUTER JOIN T_PARFOR_ETA ON T_PARFOR_ETA.IdParForEta = T_FORMATION.IdParForEta 
Where  (     CURRENT_TIMESTAMP >= DATEADD(DAY,ISNULL(-%NbJoursAvant%,0),T_Formation.DateFinSession)
		 and CURRENT_TIMESTAMP <= DATEADD(DAY,ISNULL(%NbJoursApres%,0),T_Formation.DateFinSession)
         and (ISNULL(T_PARFOR_ETA.CodeEtape,'') = ISNULL('%Statut1%','') 
              OR ISNULL(T_PARFOR_ETA.CodeEtape,'') = ISNULL('%Statut2%','')
              OR ISNULL(T_PARFOR_ETA.CodeEtape,'') = ISNULL('%Statut3%',''))
		)

