		
	IF YEAR(p_dateAnalyse)<YEAR(CURDATE()) THEN
		SELECT dateEffet,dateFin INTO @dateEffetPolice,@datefinPolice FROM hpolice WHERE idPolice=p_idPolice AND exercice=YEAR(p_dateAnalyse)  LIMIT 1;
	ELSE
		SELECT dateEffet,dateFin INTO @dateEffetPolice,@datefinPolice FROM police WHERE id=p_idPolice LIMIT 1;
	END IF;
	
	
	
	CASE WHEN YEAR(A.dateEffet)>YEAR(p_dateAnalyse) THEN DATE_FORMAT(A.dateEntree, '%d/%m/%Y') ELSE DATE_FORMAT(A.dateEffet, '%d/%m/%Y') END AS dateEffet,