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:
01203793
Views:
18
It looks like you always have just one record per iID and iTraiterID in Agenda, e.g. iID is unique and iTraiterID is unique. Scratch my code then. I need to think a bit more.

>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 ?
>
>thank sergey
>
>
>
>http://cjoint.com/data/doqK7pehJK.htm
>
>
>
>
>
>
>
>>Try
>>
>>UPDATE ap
>>		SET nstkjour = pd.nstkjour
>>	FROM AgendaPhar ap
>>		JOIN (
>>			SELECT  NVL(apd.nstkjour, t.nstkjour) AS nstkjour, apd.nID
>>				FROM AgendaPhar apd
>>					JOIN Traiter t ON t.iid = apd.itraiterId
>>				WHERE apd.ddate < vp_date
>>			) pd ON ap.nID = pd.nID
>>
>>
>>>
>>>I have a another problem with a another sql command.
>>>
>>>
>>> vp_date = DATE()
>>>* I want the stock From yesterday
>>>*-- If not exist in agendaPhar i get the stock from Traiter.dbf
>>>
>>>UPDATE AgendaPhar ;
>>>      SET ;
>>>      NVL( nstkjour = (  SELECT  apcor.nstkjour FROM AgendaPhar apcor ;
>>>      INNER JOIN Traiter Tcor ON Tcor.iid = apcor.itraiterId WHERE apcor.ddate < vp_date ) , 0 )
>>>
>>>
>>>
>>>
>>>
>>>This command give me a error when i try to save the programm.
>>>Invalid use of a visual foxpro function...
>>>
>>>A idea ?
>>>A very big thank for your help.
>>>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform