>>>So some records have an ID that already exists. Other records have unique ID.
>>>I want to run this table through a PRG and add a suffix '1', or '2', or '3' (depending on each duplicate record). So that the above table would look like this:
>
>How about something along the lines of
>
>select id_field,count(*) as cnt from mytable group by 1 order by 1 having cnt>1 into cursor c_fixme
>SCAN
> licounter=0
> update mytable set id_field = rtrim(id_field)+mysuffix() where id_field=c_fixme.cid_field
>endscan
>
>function mysuffix()
>licounter=m.licounter+1
>return transform(m.licounter)
>
Your approach works. Thank you. Let's wait till Mike comes back and tells us if this is the fastest approach :)
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham