Bonsoir Naomi,
THis Code give me a good result.
LOCAL cValue,;
lnselect
lnselect = SELECT( 0 )
SELECT Medicnom
SCAN ALL
cValue = ""
SELECT TRAITER
SCAN ALL FOR imedicId = Medicnom.iid
IF SEEK( TRAITER.iresidentid , "resident" , "primary" )
cValue = cValue + TRAITER.cnomteleph + CR
WAIT WINDOW Teleph.cnomteleph NOWAIT
ENDIF
ENDSCAN
SELECT Medicnom
REPLACE gresident WITH cValue
ENDSCAN
SELECT ( lnselect )
It possible with a Update command ?
>>Hi all,
>>
>>I HAVE
>>*-- MEDICNOM.DBF WITH TEMESTA 2.5
>>*-- TRAITER.DBF WITH JEAN - PIERRE - PAUL ( They Have Temesta 2.5 )
>>
>> medicnom.gresident is a memo field
>>
>>I want for Medicnom temesta 2.5 a value for gresident =
>>"JEAN
>>PIERRE
>>PAUL"
>>
>>
>>
>> UPDATE Me ;
>> SET gresident= '',;
>> gresident =;
>> Tr.cnomteleph + CR ;
>> FROM Medicnom Me;
>> JOIN Traiter Tr ON Tr.imedicid = Me.iid ;
>> WHERE EXISTS (;
>> SELECT Tcor.imedicid FROM Traiter Tcor )
>>
>>
>
>>Give only a record ( g PAUL and NOT PIERRE OR PAUL )
>>
>>Ps PIERRE PAUL AND JEAN HAVE Temesta 2.5
>>
>>Thank very much for help
>>
>>
>>bernhart
>
>Your request is unclear. All I can say based on the above update, that you don't need to list gResident twice and it looks like WHERE EXISTS does nothing useful.
>
>Can you select records you would want to update into the cursor when just join with this cursor in your update command? This way you would be sure what you're doing.