|
killjack Beginner
Joined: 21 Oct 2007 Posts: 11
|
Posted: Wed Oct 24, 2007 12:56 am
how to get the record number sorted in view of database? |
for example. build a database named quests.db and insert some records as following:
recordnumber type name cost
0 weapon a 10
1 armor b 50
2 drug c 30
then sorted these records by cost in a view named order and get the following order.
recordnumber type name cost
0 weapon a 10
2 drug c 30
1 armor b 50
my problem is how to get the recordnumber sorted and set them to other variables, such as.
first= the no. 1 record number sorted
second=the no. 2 record number sorted
third = the no. 3 record number sorted
any suggestion is appreciated! |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Oct 24, 2007 1:31 am |
If I am following what you want correctly then this can be done with a %query, don't quote me on the field of Num though that is from memory, and the last time I really played with the DB was 2 years ago.
Code: |
#DBRESET
variable=%query(&Num!="",order) |
Should put a list of records into 'variable' where the order of entries in the list matches the sort order for the view 'order'. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
killjack Beginner
Joined: 21 Oct 2007 Posts: 11
|
Posted: Wed Oct 24, 2007 1:54 am |
yeah,that solves my problem!
Thank you very much, Vijilante! |
|
|
|
|
|