Pour récupérer les adresses mail sur une période donnée j'effectue la requête suivante :
Code : Tout sélectionner
SELECT "TabFacture"."RefAdhFacture", "TabAdherent"."Mail" || ';' AS "CourrielSejour", "TabAdherent"."NomAdherent", "TabAdherent"."PrenomAdherent", "TabAdherent"."CP", "TabAdherent"."RefCodeRegion", "TabFacture"."DateArrivee", "TabFacture"."DateDepart" FROM "TabFacture", "TabAdherent", "XConstantes" WHERE "TabFacture"."RefAdhFacture" = "TabAdherent"."IdAdherent" AND "TabAdherent"."Mail" || ';' > '0' AND "TabFacture"."DateArrivee" >= "XConstantes"."DebutSejour" AND "TabFacture"."DateDepart" <= "XConstantes"."FinSejour" AND "TabAdherent"."Mail" <> 'adresse_courriel@modifier' ORDER BY "CourrielSejour" ASC, "TabFacture"."DateArrivee" ASCPour éliminer ces doublons je veux utiliser la fonction "Groupe" sur le champ "TabFacture"."RefAdhFacture" avec la requête suivante :
Code : Tout sélectionner
SELECT "TabFacture"."RefAdhFacture", "TabAdherent"."Mail" || ';' AS "CourrielSejour", "TabAdherent"."NomAdherent", "TabAdherent"."PrenomAdherent", "TabAdherent"."CP", "TabAdherent"."RefCodeRegion", "TabFacture"."DateArrivee", "TabFacture"."DateDepart" FROM "TabFacture", "TabAdherent", "XConstantes" WHERE "TabFacture"."RefAdhFacture" = "TabAdherent"."IdAdherent" AND "TabAdherent"."Mail" || ';' > '0' AND "TabFacture"."DateArrivee" >= "XConstantes"."DebutSejour" AND "TabFacture"."DateDepart" <= "XConstantes"."FinSejour" AND "TabAdherent"."Mail" <> 'adresse_courriel@modifier' GROUP BY "TabFacture"."RefAdhFacture" ORDER BY "CourrielSejour" ASC, "TabFacture"."DateArrivee" ASCOù est mon erreur ?
Ce sont les requêtes :
- "ReqMailAdherentFactureSejour" (sans suppression doublon) et
- "ReqMailAdherentFactureSejourNew" (avec essai de suppression doublon)
Nota : Il y a une erreur macro à l'ouverture de la base car j'ai supprimé tous les formulaires pour alléger la base.
Merci de votre aide.
Éric


