SELECT
 (T_SAL.MatriculeSalarie || ' ' || NVL(T_SAL.Nom, ' ') || ' '  || NVL(T_SAL.Prenom, ' ') ) as Col1,
 'Date de fin d''absence : ' || TO_CHAR(T_GHRSAL.PeriodeFin) as Col2
FROM
  T_PAI,
  T_SAL
  LEFT OUTER JOIN T_GHRSAL ON T_GHRSAL.NumSalarie=T_SAL.SA_CompteurNumero
WHERE ( ( NVL(%Mois%,0) = 0
         AND T_GHRSAL.PeriodeFin   >= TO_DATE(TO_CHAR(1)||'/'||TO_CHAR(T_PAI.MoisEnCours)||'/'||TO_CHAR(T_PAI.AnneeEnCours))-1
         AND T_GHRSAL.PeriodeDebut <= TO_DATE(TO_CHAR(1)||'/'||TO_CHAR(T_PAI.MoisEnCours)||'/'||TO_CHAR(T_PAI.AnneeEnCours))-1
        )
       OR
        ( NVL(%Mois%,0) = 1
         AND T_GHRSAL.PeriodeFin   >= TO_DATE(TO_CHAR(1)||'/'||TO_CHAR(T_PAI.MoisEnCours-1)||'/'||TO_CHAR(T_PAI.AnneeEnCours))-1
         AND T_GHRSAL.PeriodeDebut <= TO_DATE(TO_CHAR(1)||'/'||TO_CHAR(T_PAI.MoisEnCours-1)||'/'||TO_CHAR(T_PAI.AnneeEnCours))-1
        )
      )
    and (   T_GHRSAL.CodeNE = NVL(%NatureAbsence1%,0)
         OR T_GHRSAL.CodeNE = NVL(%NatureAbsence2%,0)
         OR T_GHRSAL.CodeNE = NVL(%NatureAbsence3%,0)
        )
Order by T_SAL.MatriculeSalarie, T_GHRSAL.CodeNE