Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index Problem
Message
 
 
To
05/03/2000 09:14:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00341845
Message ID:
00341855
Views:
18
Hi Joro,
>
>I want to know if VFP6.0 have some command or funtion that put all key fields like that,
>
>Value Field = 1 = 00001
>Value Field = 2 = 00002
>
>Othervise i can get the Index like that
>
>1
>100
>1000
>2
>20
>3
>30
>300.... What is wrong.
>

This example shows us that you're using character expression for this field.
If the real data will be always numeric, as you show, you should use either numeric, or, much better, Integer data type and you will not have your problem.

If you're sure, for some reaosn you need Character data type for this field, you can use val(Field1) in your Index expression. It would work only if all data in the table in Numeric format:
1
15
2
25
3
40

Another solution, use PADL(field1, fsize(field1),'0') - this should work.
Instead of len(field1) use the real field size, like 5, for example.

HTH
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform