> 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
INSERT INTO dly (code,date, type, category, scode, lcode, sec); SELECT Student.code, pdate,; && I don't see from where that variable comes from in your coude 1,; [P],; Student.scode,; Student.lcode,; Student.sec; FROM Student; LEFT JOIN Dly ON Student.Code = Dly.Code; WHERE Dly.Code IS NULL