Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very complicated index expression
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Very complicated index expression
Miscellaneous
Thread ID:
00605398
Message ID:
00605398
Views:
67
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...
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform