Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
YAQ on index
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01654619
Message ID:
01654626
Views:
60
>Hi,
>
>I need to index a cursor on two columns, one is type NUMERIC(2,0) (COLUMN1) (the value is always a hole number, 1,2,5,3, 12); the other column (COLUMN2) is c(15) but I need to show the values in the order converted to a number. For example, the second column values could be:
>'3330023'
>'23'
>'5667'
>'9900'
>And I need to have them shown in their "numberic" order as
>'23'
>'5667'
>'9900'
>'3330023'
>The index has to be an expression that has +. For example,
>COLUMN1 + INT(VAL(COLUMN2))
>
>But obviously the above will not give me what I am looking for.
>
>TIA for any input

Try

INDEX ON padl(column1, 2, '0') + padl(alltrim(column2),15,'0')
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform