>Select scode,Descr,lcode,Sec,code_a,name,weight,Examcode,; > (Cast(Sum(obt01) As I)) /Count(code_a) As CW,; > (Cast(Sum(obt02) As I)) /Count(code_a) As HW,; > (Cast(Sum(obt03) As I)) /Count(code_a) As Calli,; > (Cast(Sum(obt04) As I)) /Count(code_a) As Clean,; > (Cast(Sum(obt05) As I)) /Count(code_a) As Presence; > WHERE year=kpsYEar AND nmonth<9; > FROM awardlist ; > GROUP By lcode,Sec,code_a; > order By lcode,sec ; > INTO table moontt >Please see corrections. How your table and a cursor are related?
UPDATE exAMtraN from exAmTraN inner join Moontt on ExamTran.PK = Moontt.PK SET obt01 = Moontt.cw, obt02 = Moontt.hw, obt03 = Moontt.calli, obt04 = clean; WHERE ExamTran.year = Moontt.KPSYEAR AND examtran.examcode="Annual 07-08"