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:
00120913
Vues:
17
Jim (et al),

Thanks for your attempt at assistance. I looked back at my data and found that all of my enddates were the same day. So naturally most of the effdates found two chgitems that met the date criteria. Sorry for the panic, but glad to know there's help out there when you need it.

>>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
>
-cjh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform