In this case you can select all records you want to process into a cursor, scan it and process record by record. You can use SEEK to speed up finding records in the tables.
>if i scan, how do i incorporate the other table under another alias into the equation. here is kind of what i was thinking.
>
>do while not eof() (or some other condition)
>
> select a_alias
> locate for custid = id, field2 < 0 , field3 = variable
> insert into table (fieldnames) values (variablenames)
> update a_alias
> set field2 = something, field3 = somethingelse
> where custid = id
>
> select a_anotheralias
> insert into table (fieldnames) values (variablenames)
> .....the variables on this one are set from some fields in the original locate
>
>next
>
>the problem is though that the tables are pretty big and the locate is slow as a dog. any suggestions? thanks.
--sb--