SELECT
TableHydrant.idHydrant AS idHydrant,
TableCommunes.commune AS commune
FROM
TableCommunes,
TableHydrant
WHERE
TableCommunes.inseeCommune = TableHydrant.inseeCommune
AND
(
TableCommunes.commune LIKE {Param_commune}%
)
ORDER BY
idHydrant ASC
sAnomalie est une chaine
Rs est une source de donnees
SQL est une Chaine
//Ici IdAnomlie représente ma clé unique du fichier TableAnomalies
SQL = "SELECT IdAnomalie FROM TableHydrantsAnomalies WHERE idHydrant = " + MaSource.idHydrant
//On recherche toutes les anomalies liées à un idHydratant
SI PAS HExecuteRequeteSql( Rs, HRequeteDefaut, Sql ) Alors
ERREUR(HErreurInfo()
RETOUR
FIN
//Ici On concatène les libellés trouvé
POUR TOUS Rs
//On se position sur l'anomalie liée
HLitRecherche (TableAnomalies,IdAnomalie, Rs.IdAnomalie)
Si sAnomalie <> "" Alors sAnomalie += "; "
sAnomalie = TableAnomalies.libelle
Fin
//Ici affecté sAnnomalie à un champs de votre état style
LIB_DANS_ETAT = sAnomalie
HAnnuleDeclaration (Rs )
Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=18&topic_id=5677&post_id=23267