>Gerald,
>
>It doesn't make any difference if you pad with X's or you let str() use spaces. Your index expression would be a bit slower because of the extra function calls involved.
>
>>STR() return a lot of spaces, try to index with something like:
>>
>>PADL(ALLTRIM(STR(ParentID)),10,"X")+PADL(ALLTRIM(STR(ChildOrder)),10,"X")
>>
I know that this will not make any difference for the index itself.
As you said, this may be slower to create the index (millisecond? seconds?).
But, the string used in the seek will be easier to construct and can be used directly as a treeview key (and this is the case here I think).
I think the previous paragraph is enough to justify the use of the padded string IMHO.
:-)
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca