Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update Sql Command
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01202518
Message ID:
01203456
Views:
20
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform