Update curbilldata set tot_tot=(Select sum(master.tot_t/2) from curbilldata master where master.divi=curbilldata.divi)NB! Note that this line may not do the work without modifications, but is should be a very good start!
>USE curbilldata >DO WHILE NOT EOF() > m.divi = curbilldata.divi > DO WHILE m.divi = curbilldata.divi AND NOT EOF() > > SKIP > ENDDO > > > > SUM(tot_t) to m.r for m.divi = curbilldata.divi > replace tot_tot WITH m.r/2 for m.divi = curbilldata.divi > if !eof() > skip > endif >enddo >>
>>. >>if !eof() >> skip >>endif >>. >>>>or similar construction.
>>>USE curbilldata >>>DO WHILE NOT EOF() >>> m.divi = curbilldata.divi >>> DO WHILE m.divi = curbilldata.divi AND NOT EOF() >>> >>> SKIP >>> ENDDO >>> >>> >>> IF NOT EOF() >>> >>> SUM(tot_t) to m.r for m.divi = curbilldata.divi >>>m.qa=(VAL(curbilldata.tot_t))/(VAL(curbilldata.tot_tot))&&Function argument value, type, or count is invalid >>>? m.qa >>> replace tot_tot WITH m.r/2 for m.divi = curbilldata.divi >>>skip &&End of file encountered >>>endif >>>enddo >>>brow >>>>>>