Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The best way to use a portion of a field for indexing
Message
De
02/02/2005 14:12:10
 
 
À
02/02/2005 10:45:47
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00975802
Message ID:
00983170
Vues:
26
Hi Steven,

if your first select statement does not work, but your second ALWAYS works, the reason must be that LEN(emp1no)#LEN(employeenumber), or LEN(jobno)#LEN(JobNumber). Find out which length does not match, and use the PADR() function.
Select * From ntimetbl Where emp1no+DTOC(wend)+PADR(jobno,10) == checkthisentry InTo Cursor myVerifySingle
OR
Select * From ntimetbl Where PADR(emp1no,10)+DTOC(wend)+jobno == checkthisentry InTo Cursor myVerifySingle
OR
Select * From ntimetbl Where PADR(emp1no,10)+DTOC(wend)+PADR(jobno,10) == checkthisentry InTo Cursor myVerifySingle
You need to replace 10 with the actual field length.


if your first select statement does not work, but your second ALWAYS works, I can conclude that LEN(ALLTRIM(emp1no)) is constant. This is because

>I am hung up on an index again and need some help with this post you made to me about AllTrim in an index.
>
>My Index is set on employeenumber+DTOC(weekDate)+JobNumber.
>
>The data in this fields is variable length.
>
>My Select statement is
>
>Select * From ntimetbl Where emp1no+DTOC(wend)+jobno == checkthisentry InTo Cursor myVerifySingle
>
>This will not work unless I use
>Select * From ntimetbl Where AllT(emp1no)+DTOC(wend)+AllT(jobno) == checkthisentry InTo Cursor myVerifySingle
>
>Which I am not sure takes advantage of the index.
>
>Please help me to understand.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform