hello ,
i try i get error messag
function name is missing
thanks.
>You should learn SQL, you will save a looot of time! Something like this will replace your whole little program:
>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!
>
>>hi,
>>thank you for reply.
>>1.i try as under,no error but it sum for one divi ,no skip to another divi
>>
>>
>>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
>>
>>
>>
>>>Hi There ,
>>>First error is because you are issuing skip
>>>before checking for end of file.
>>>So eventualy you 'hit the rock'.
>>>Normally shld be ;
>>>
>>>.
>>>if !eof()
>>> skip
>>>endif
>>>.
>>>
>>>or similar construction.
>>>
>>>For second error I cannot say right away
>>>but seem that u r passing wrong values to some function (SUM ?)
>>>
>>>What are you are trying to do is bassicaly grouped
>>>records processing and can be perfomed much more
>>>elagant with nested scans instead of do while(s),
>>>provided that there is index tag on this 'divi' field
>>>
>>>Rgds++
>>>
>>>
>>>
>>>>hi all,
>>>>any idea ,help
>>>> i try to run code under i get error message
>>>>1.End of file encountered
>>>>2.Function argument value, type, or count is invalid.
>>>>
>>>> &&two fields type is characters&&
>>>>
>>>>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))
>>>>? m.qa
>>>> replace tot_tot WITH m.r/2 for m.divi = curbilldata.divi
>>>>skip
>>>>endif
>>>>enddo
>>>>brow
>>>>
>>>>
>>>>thanks.