[quote=&quot;Toontoon&quot;:bzyjygpq]Heu ma solution marche MC  <!-- s:-) --><img src="{SMILIES_PATH}/smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:bzyjygpq]

je confirme  <!-- s:content: --><img src="{SMILIES_PATH}/content.gif" alt=":content:" title="" /><!-- s:content: -->  <!-- s:content: --><img src="{SMILIES_PATH}/content.gif" alt=":content:" title="" /><!-- s:content: --> 

[code:bzyjygpq]select
SERVICE&#46;NOM,
count(distinct p&#46;prelevement_id) as Nb_prlv,
sum(case when (date_format(p&#46;DATE_ARRIVEE,'%T') not in ('00&#58;00&#58;00') and date_format(p&#46;DATE_PRELEVEMENT, '%T') not in ('00&#58;00&#58;00') and timestampdiff (minute, p&#46;DATE_PRELEVEMENT, p&#46;DATE_ARRIVEE) &gt; '30') then 1 else 0 end) as nb30

from
PRELEVEMENT p left join ECHANTILLON e on e&#46;PRELEVEMENT_ID = p&#46;PRELEVEMENT_ID, ECHANTILLON_TYPE, SERVICE, ETABLISSEMENT

where
SERVICE&#46;ETABLISSEMENT_ID = ETABLISSEMENT&#46;ETABLISSEMENT_ID
and
SERVICE&#46;SERVICE_ID = p&#46;SERVICE_PRELEVEUR_ID
and
p&#46;PRELEVEMENT_ID = e&#46;PRELEVEMENT_ID
and
e&#46;ECHANTILLON_TYPE_ID = ECHANTILLON_TYPE&#46;ECHANTILLON_TYPE_ID
and
ECHANTILLON_TYPE&#46;TYPE like 'TI%'
and
e&#46;EMPLACEMENT_ID is not null
and
date_format(e&#46;date_stock,'%Y') in ('2014')
and
date_format(e&#46;date_stock,'%m') in ('01','02','03','04','05','06')
and
ETABLISSEMENT&#46;NOM like 'CHU J%'

group by
SERVICE&#46;NOM[/code:bzyjygpq]

J'ai juste un petit soucis, le chiffre retourné dans la colonne qui compte les enregistrements selon la condition ne sont pas les même que quand je les compte dans une requête simple