Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The best way to use a portion of a field for indexing
Message
From
05/02/2005 21:47:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/02/2005 10:45:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00975802
Message ID:
00984259
Views:
23
>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.

Make search expression fit to index signature (assuming your index: emp1no+DTOC(wend)+jobno):
Select * From ntimetbl ;
  Where emp1no+DTOC(wend)+jobno == ;
    padr(m.emp1no,fsize('emp1no','ntimetbl'))+dtoc(m.dVar)+m.jobno ;
  InTo Cursor myVerifySingle
PS:Dtoc(m.dVar) is dependant on current date setting. dtoc(m.dvar,1) would be safe.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform