Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update Sql Command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01202518
Message ID:
01203456
Vues:
19
>Hello Sergey,
>
>I have problem.
>AgendaPhar Have no record with ddate < vp_date
>I want dus T.nstock
>
>
> SELECT  NVL( apd.nstkjour, T.nstock ) AS nStkjourCor, apd.iTraiterId ;
>    FROM AgendaPhar apd ;
>    JOIN Traiter T ON T.iid = apd.itraiterId ;
>    WHERE apd.ddate < vp_date ;
>    )
>
>
>Give No record and your request give me 0 ..? IN place Of T.nstock
>
>A idea ?
>
You may try:
SELECT  NVL( apd.nstkjour, T.nstock ) AS nStkjourCor, apd.iTraiterId ;
    FROM AgendaPhar apd ;
    JOIN Traiter T ON T.iid = apd.itraiterId ;
    WHERE apd.ddate < vp_date ;      
union ;
select T.nStock AS nStkjourCor, apd.iTraiterId ;
    FROM AgendaPhar apd ;
    JOIN Traiter T ON T.iid = apd.itraiterId
This would add records where dates are >=vp_date
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform