Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Funny index order
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00115751
Message ID:
00115780
Views:
13
>>>>I have a numeric field I'm trying to index. The data in the field look like, for example:
>>>>
>>>>0,2,5,0,12,0,0,15,17,...
>>>>
>>>>I want to order them like:
>>>>
>>>>2,5,12,15,17,0,0,0,0,...
>>>>
>>>>Any ideas how I can do this?
>>>
>>>calculate max(field1) to nMax
>>>index on iif(field1=0,nMax+1,field1) tag q
>>>set order to q
>>
>>Excellent! Thanks Edward.
>
>You know, this one is probbaly even better:
>index on iif(field1=0,field1,1/field1) tag q desc

I should be patient, you keep getting better solutions :)
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform