Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding for rank
Message
From
23/09/2008 04:49:32
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2008 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01349737
Message ID:
01349742
Views:
21
Select * from rank order by tm desc into cursor curdummy READWRITE
Update curdummy set rank = Recno()
Update curdummy set rank=(select Min(rank) from curdummy temp where temp.tm=curdummy.tm)
Update rank from curdummy set rank = curdummy.rank where curdummy.student=rank.student
Select * from rank
>Hi,
>
>I thought similar but it doesn't cope with equal scores by two students.....
>Best,
>Viv
>
>>Since total is a reserved word, I use tm insetad of total.
>>Select * from rank order by tm desc into cursor curdummy READWRITE
>>Update curdummy set rank = Recno()
>>Update rank from curdummy set rank = curdummy.rank where curdummy.student=rank.student
>>
>>>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.
>>>
>>>How to Write source code?
Previous
Reply
Map
View

Click here to load this message in the networking platform