Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outer Join Won't Limit Records
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00120154
Message ID:
00120196
Vues:
21
>All you SELECT gurus out there - Help me!!!
>
>I've a SELECT that used to work, but now appears to not be working. It's returning records that match on chgitem, but is ignoring the effdate criteria. How do I get this to work?
>
>SELECT chgitem, units, amount, NVL(lcdm.cost, 0.0000) AS cost ;
> FROM ccharges LEFT OUTER JOIN lcdm ON ccharges.chgitem = lcdm.chgitem ;
> AND ccharges.chgdate BETWEEN lcdm.effdate AND lcdm.enddate
>
>The return set is giving me multiple records for a chgitem regardless of the effdate match. I've tried putting the chgdate clause in the WHERE clause as well as a HAVING clause all to no avail.
>
>Thanks in advance.
Curtis,

Here's an adjustment that takes the non join criteria out of the join clause.
SELECT chgitem, units, amount, NVL(lcdm.cost, 0.0000) AS cost ;
  FROM ccharges LEFT OUTER JOIN lcdm ON ccharges.chgitem = lcdm.chgitem ;
 WHERE ccharges.chgdate BETWEEN lcdm.effdate AND lcdm.enddate
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform