It doesn't work if pr_number has values less than 8 digits. The transform with the @L adds leading zeros so that smaller numbers sort properly.
>Hmmm. Why the change? Performance perhaps? I thought the other expression would work, too.
>
>>Whoops! Not quite! How about:
>>
>>index on UPPER(ts_number) + transform(99999999 - pr_number,'@L 99999999')
>>
>>>Hi Randy,
>>>
>>>How about:
>>>
>>>UPPER(ts_number)+LTRIM(STR(99999999 - pr_number,8,0))
>>>
>>>>Hi,
>>>>I need to be able to create an index with 2 fields where the first column is ascending and the second column is descending. They are both character fields. This is how the data looks:
>>>>
kenweber
GCom2 Solutions
Microsoft Certified Professional