>SELECT Exam.code as exmcode, Exam.descr, Exam.fmdate, ; >Exam.year, Exam.change1, Exam.sno,; > Exam.nmonth, Exam.bex, Exam.begdate, ; >Student.code as zcode, Student.descr as zname,; > Student.fname, Student.sex, Student.sec, ; >Student.lcode, Student.scode,; > Student.broll, Student.path; > FROM student,; > exam; > ORDER BY Exam.exmcode; > WHERE student.scode=thisform.scode.value; > .and. student.lcode=thisform.lcode.value ; and student.sec=thisform.sec.value.and.student.admtd=1; >.and. Exam.exmcode=thisform.code.value; >into cursor newPut Order by 1 instead. You can not use new (created) names in ORDER BY clause.