SELECT left(arc_expl_cote,3) as 'Début de cote', location_libelle as Localisation, section_libelle as Section, tdoc_libelle as Support, year(arc_debut) as annee, CASE WHEN month(arc_debut)=1 THEN "Janvier" WHEN month(arc_debut)=2 THEN "Février" WHEN month(arc_debut)=3 THEN "Mars" WHEN month(arc_debut)=4 THEN "Avril" WHEN month(arc_debut)=5 THEN "Mai" WHEN month(arc_debut)=6 THEN "Juin" WHEN month(arc_debut)=7 THEN "Juillet" WHEN month(arc_debut)=8 THEN "Août" WHEN month(arc_debut)=9 THEN "Septembre" WHEN month(arc_debut)=10 THEN "Octobre" WHEN month(arc_debut)=11 THEN "Novembre" WHEN month(arc_debut)=12 THEN "Décembre" else "Erreur sur mois" END AS mois, week(arc_debut) as semaine, DATE_FORMAT(DATE_ADD(arc_debut, INTERVAL -weekday(arc_debut) DAY),"%d/%m/%Y") as "semaine du lundi...", count(*) as "Total semaine" FROM `pret_archive` LEFT JOIN docs_location ON idlocation=arc_expl_location LEFT JOIN docs_section ON arc_expl_section=idsection LEFT JOIN docs_type on arc_expl_typdoc=idtyp_doc  WHERE arc_debut >= "!!date_debut!!" AND arc_debut <= DATE_ADD("!!date_fin!!", INTERVAL 1 DAY) AND arc_expl_cote like "!!cote!!%" AND arc_expl_location IN (!!localisationn!!) AND arc_expl_section IN(!!sectionn!!) AND arc_expl_typdoc in (!!choixsupport!!) GROUP BY 1, Localisation,Section, Support, annee, mois, semaine ORDER BY annee ASC, month(arc_debut) ASC, semaine ASC, 1 ASC, Localisation ASC, Section ASC, Support ASC