General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only