Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing with Numeric Fields
Message
From
01/07/1999 15:17:42
Kenneth Downs
Secure Data Software, Inc.
New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00236640
Message ID:
00236644
Views:
9
Paul,

The STR() function by default creates strings of 10 characters.

In my previous life when I did accounting software, I always used type character for the chart of accounts. Made things much easier, as I could combine any fields I wanted in an index.

>I am having a problem dealing with index's on numeric fields.
>
>I have a chart of accounts file with three fields. 2 numeric fields coa_glno(ledger#) with a width set to 3 and coa_glsub(ledger sub#) with a width set to 2 and a character description field.
>
>I have a candidate index called coa_glno with the following expression "str(coa_glno)+str(coa_glsub)". If I have a record in the table with a coa_glno of 123 and coa_glsub of 45 I notice that the index expression yields " 123 45". I am not sure why I have all of these leading spaces. This is causing great headaches in trying to do searches on this table with this particular index. I was considering using alltrim in the index. However, how would it distinguish between 123-45 and 12-345?
>
>I am struggling with the best way to handle these indexes and then, also the best way to search on these indexes.
>
>Thanks,
>Paul Acton
Previous
Reply
Map
View

Click here to load this message in the networking platform