What are the types of the fields? If the fields are integer, you can use BINTOC function.
>Well, I have approached this from several vantage points to get the line item numbers
>in numeric order, but they do not come out okay when I make my index as follows:
>
>
>INDEX on PADL(ALLTRIM(STR(groupid)), "") + PADL(ALLTRIM(STR(quoteid)), 4, " ") + ;
> PADL(ALLTRIM(STR(lineitem)), 4, " ") TAG gqteline
>
>
>Example: The numbers for the column called LineItem just don't go into any order.
>I even padded spaces in, but that didn't fix it.
>
>
>GROUPID QUOTEID LINEITEM
>1 1 2
>1 2 1
>
>
>How do I get the numbers to come out like this in the index expression?
>
>GROUPID QUOTEID LINEITEM
>1 2 1
>1 1 2
>
>
>Maybe I need to leave out the QuoteID? I'll try that.
>
>Cecil answering Cecil's question: "Yes, that works just fine, Cecil. Good job!" See below:
>
>INDEX on groupid + lineitem TAG grpqteline
>
If it's not broken, fix it until it is.
My Blog