
Modifying each record in a table using data from the previous record in the same table
Modifying each record in a table using data from the previous record in the same table
I am trying to copy data from one field in the first record of a table to a field in the second record of the table and to continue that process through all the records in the table. There is no sequential field in the table because I'm clustering the records as are entered to maintain a particular sort pattern. Any ideas on how this can be accomplished.
Re:Modifying each record in a table using data from the previous record in the same table
It they are clustered and you simply want to copy a field value from a previous record to the next it is easy:
any DQL with no sorting will process data in saved i.e. clustered order
define "MyValue" text .
define "Counter" number .
for MyForm ;
if counter>0 then
modify records
SecondField := MyValue .
end
MyValue := FirstField .
Counter := Counter +1 .
end
This DQL will "keep" FirstField value from the previous record and save it in the following record.