select tdoc_libelle as Support, CASE WHEN (!!param1!! - arc_empr_year)<=3 THEN 'Petite enfance (0 à 3 ans)' WHEN (!!param1!! - arc_empr_year)>3 and (!!param1!! - arc_empr_year)<=5 THEN 'Maternelle (4 à 5 ans)' WHEN (!!param1!! - arc_empr_year)>5 and (!!param1!! - arc_empr_year)<=10 THEN 'Primaire (6 à 10 ans)' WHEN (!!param1!! - arc_empr_year)>10 and (!!param1!! - arc_empr_year)<=15 THEN 'Jeune (11 à 15 ans)' WHEN (!!param1!! - arc_empr_year)>15 and (!!param1!! - arc_empr_year)<=25 THEN 'Jeune adulte (16 à 25 ans)' WHEN (!!param1!! - arc_empr_year)>25  THEN 'Adulte (+25 ans)' else 'Erreur sur âge' END as "Tranche d'âge", count(arc_id) as Nombre from pret_archive left join docs_type on arc_expl_typdoc=idtyp_doc where arc_expl_typdoc in (!!choixtypdoc!!) and year(arc_debut)=!!param1!! group by 1,2 order by 1,2