>Thank naomi.
>
>But i have a another probleme because "nstkjour" do'nt accept Null value...
>
>bernhart
>
I'm not sure what exactly do you want to do. Do you want to update all nStkJour field with the value from the previous date?
E.g.
SELECT nvl(apcor.nstkjour,tcor.nStkJour) as nStkJour, apCor.nID ;
FROM AgendaPhar apcor ;
INNER JOIN Traiter Tcor ON Tcor.iid = apcor.itraiterId ;
WHERE apcor.ddate < vp_date into cursor curChanges
update AgendaPhar set nStkJour =curChanges.nStkJour ;
from AgendaPhar inner join curChanges on ;
AgendaPhar.nID = curChanges.nID
>
>>>Thank Sergey.
>>>
>>>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.
>>>
>>Bernhart,
>>
>>In update command you can not use NVL for the field you're updating. In other words, it should be
>>
>>Update MyTable Set MyField = ....
>>
>>Move NVL to the proper place in the command.
If it's not broken, fix it until it is.
My Blog