Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very complicated index expression
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00605398
Message ID:
00606122
Vues:
19
>Nadya,
>This seems to be working too:
>
>UPPER(PADR(TRIM(SUBSTR(OWNER,AT('=',OWNER)+1,AT('=',OWNER+'=',2)-AT('=',OWNER)-1)+;
>LEFT(OWNER,AT('=',OWNER+'=')-1)),25))
>
I changed it a little bit:
?UPPER(PADR(TRIM(SUBSTR(OWNER1,AT('=',OWNER1)+1,AT('=',OWNER1+'=',2)-AT('=',OWNER1)-1))+ ;
" "+LEFT(OWNER1,AT('=',OWNER1+'=')-1),25))
Here is my own, which seems to be more complicated, so I'll switch to yours:
UPPER(PADR(TRIM(IIF(AT("=",OWNER1,2)>0, ;
     SUBSTR(OWNER1,AT("=",OWNER1)+1,AT("=",OWNER1,2)-AT("=",OWNER1)-1), ;
     SUBSTR(OWNER1,AT("=",OWNER1)+1)))+" "+;
     IIF(AT("=",OWNER1)>0,LEFT(OWNER1,AT("=",OWNER1)-1),""),26))
Thanks again. - is a good string function, which I always forgot about



>>Thanks for your response. Actually I meant not the result of the indexing (it would be 29 chars in my case), but the index expression itself. However, I've tried this new expression right now and it worked just fine. It surely looks complex :)
>>
>>
>><font color=blue>index</font><font color=blue> on</font> ;
>>town+<font color=blue>UPPER</font>(<font color=blue>PADR</font>(<font color=blue>TRIM</font>(<font color=blue>IIF</font>(<font color=blue>AT</font>("=",OWNER1,2)>0,<font color=blue>SUBSTR</font>(OWNER1, ;
>><font color=blue>AT</font>("=",OWNER1)+1,<font color=blue>AT</font>("=",OWNER1,2)-<font color=blue>AT</font>("=",OWNER1)-1),<font color=blue>SUBSTR</font>(OWNER1,<font color=blue>AT</font>("=",OWNER1)+1)))+ ;
>><font color=blue>IIF</font>(<font color=blue>AT</font>("=",OWNER1)>0,<font color=blue>LEFT</font>(OWNER1,<font color=blue>AT</font>("=",OWNER1)-1),""),25))<font color=blue> tag</font> name1
>>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform