>Hi,
>
>How do you append from one cursor to another with FOR?
>
>I tried:
>
>select C_CURSOR1
>append from DBF("C_CURSOR2") fields FLD1, FLD2 FOR C_CURSOR2.FLD1 = "123"
>
>
>But it appends ALL records from the cursor C_CURSOR2 instead of just the ones matching the FOR
>
>What am I missing?
IIRC, the active record in cursor2 is not moving during the import. The for condition is applied to each record after it is inserted into c_cursor1. As each record is imported it looks at c_cursor2, and sees that the value matches and leaves the record in c_Cursor1. You'd need a relation between cursor1 and cursor2 for the record pointer in cursor2 to move.
To do it really obviously and cleanly,
select * from cursor2 where fld1="123" into cursor c_cursor3 nofilter
select c_cursor1
append from dbf("c_cursor3")