Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very complicated index expression
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00605398
Message ID:
00606109
Views:
22
Substr(Owner1, At("=", Owner1)+1, At("=", Owner1+"=",2)-At("=", Owner1)-1) + ;
    Left( Owner1, At("=", Owner1) -1) + ;
    Substr(Owner1, At("=", Owner1+"=",2)+1)
>Hi everybody,
>
>We store names in this format FirstName Initial(1)=LastName=Suffix (Char 25), e.g.
>James H=Smith=3rd
>Nelson W=Smith, etc.
>
>Here is a current index expression:
>index on ;
>UPPER(PADR(TRIM(SUBSTR(OWNER1,AT("=",OWNER1)+1))+ ;
>IIF(AT("=",OWNER1)>0,LEFT(OWNER1,AT("=",OWNER1)-1),""),25)) ;
>tag name1
>
>However, this index expression doesn't correctly work with names with suffix.
>
>I have separate UDF functions like GetLName, GetFName, however, I don't think it's a good idea to use UDFs in Index expression. So, could you please help me with modifying the current one to properly work with suffixes. Also here is another potential problem, if index expression becomes longer than 255 chars...
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform