Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexed Table Displaying in Incorrect Order
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00726119
Message ID:
00726289
Views:
15
Understood.
Tks.

>Allan,
>
>As Hilmar pointed out, you can not use TRANSFORM function here. If both fields are integer, look at BINTOC() function in Help. Otherwise use STR with the maximum length. Say, you have numeric field N(7). You need to use STR(MyNumericField,7)
>
>
>>Houston,
>>
>>I don't know if it was because of the forest/trees or because it is 2 am :(.
>>Of course - it is because I was adding the values (literally).
>>Thank you for pointing that out!
>>
>>A '@t' is necessary in the transform function otherwise the result is:
>>1 1
>>1 10
>>1 11
>>1 2
>>
>>I am sure that you saved me hours of pulling my hair out.
>>
>>>>I know that I must be missing something very basic but ...
>>>>
>>>>I created a free table that includes several integer fields and indexed on two of these fields, IE index on IFLDA + IFLDB tag XFLDAB.
>>>>Then I set order to XFLDAB, goto top and then browse.
>>>>The records are not displayed in the correct order.
>>>>For example:
>>>>
>>>>IFLDA IFLDB
>>>>
>>>>1 1
>>>>1 2
>>>>2 1
>>>>1 3
>>>>2 2
>>>>
>>>>I know that if you want to combine a string field and non-string field in an indexed expression that the non-string fields have to be converted to strings. Is this true for any index expression of more than one field?
>>>>
>>>>TIA.
>>>
>>>
IFLDA   IFLDB
>>>1    +      1      = 2
>>>1    +      2      = 3
>>>2    +      1      = 3
>>>1    +      3      = 4
>>>2    +      2      = 4
>>>
>>>The result looks ascending to me. I guess you really meant to concatenate (string version of) the values, and not just sum them. Try using:
>>> Index on Transform( iFldA ) + Transform( iFldB ) Tag XFLDAB
Regards,

Allan Coganovitch
allanc@proven-solutions.com
Previous
Reply
Map
View

Click here to load this message in the networking platform