SELECT * FROM rank ;
ORDER BY TotalMarks DESC, Maths DESC, English DESC, Science DESC ;
INTO CURSOR crsRanked READWRITE
REPLACE ALL Rank WITH RECNO()
UPDATE rank ;
SET rank = crsRanked.rank ;
FROM rank JOIN crsRanked ON crsRanked.StudentID = rank.StudentID
>I have create a student rank.dbf with five fields namely 1. English 2. Maths 3. Science 4. Total marks 5. Rank.
>
>I want to put the Rank for each student based on their Total marks secured.The total marks is out of 500.
>
>For example student A secured total marks is 489 out of 500 and student B is 492 and student C is 389 and student D is 391.
>
>The Rank for Student B is 1 and student A is 2 and student D is 3 and student C is 4.
>
>if the student got same total marks, first go to the Maths field and check those who secured highest marks in maths, again the tie will come then go to the english field check those who secured highest marks in english.
>
>Let assume the student A English marks is 75 maths is 95 and science is 81 the total is 251. and student B english marks is 80 maths is 79 and science is 92 the total is 251. check first maths field marks the student A is 95 and student B is 79 so the student A is first and student B is second.
>
>How to Write source code?
--sb--