1) select * from Student where AdmTd = 1 and ; Code not in (select code from Dly) ; into cursor curNewStudents nofilter 2) ** First select may be re-written using LEFT JOIN, usually it's faster if _tally > 0 && we do have new students to insert insert into Dly (code, date, type, dategory, scode, lCode, sec) ; select code, m.pDate, 1, "P", scode, lCode, Sec from curNewStudents endif>I am replaceing the records wiht these codes. require some advice or sql help.only 900 records, timing is more 80 seconds.
> Select student > Set Order To CODE > Set Filter To admtd=1 > Goto Top > Do While !Eof() > grno = code > mscode = scode > mlcode = lcode > msec = sec > Select dly > Set Order To CODE > Seek grno > If Found() > Select student > Skip > Else > Select dly > Append Blank > Replace code With grno > Replace date With pdate > Replace type With 1 > Replace category With "P" > Replace scode With mscode > Replace lcode With mlcode > Replace sec With msec > Select student > Skip > Endif > Enddo > Endif > Endif