Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index on multiple columns (fields)
Message
From
22/07/2003 23:39:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
22/07/2003 23:13:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00812633
Message ID:
00812638
Views:
14
>Hi Everyone,
>
>I want to index my table on two columns (item_code + item_date). I want to index in such way that,
>
>Item_date is sorted in descending order and item code is sorted on ascending order.
>
>E.g.
>Item_code Item_date
>========= =========
>Item1 01/01/2003
>Item2 01/01/2003
>Item3 01/01/2003
>Item1 01/04/2003
>item2 01/04/2003
>item3 01/04/2003
>
>The above should be displayed as;
>Item_code Item_date
>========= =========
>Item1 01/04/2003
>Item2 01/04/2003
>Item3 01/04/2003
>Item1 01/01/2003
>item2 01/01/2003
>item3 01/01/2003
>
>Any suggestions???
>
>Cheers
>Shaishav
index on bintoc(date(2999, 1, 1) - item_date) + item_code
bintoc() is similar to str(), but it uses less space.

The example above requires VFP 6 or later.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform