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
10/01/2005 16:14:57
 
 
À
10/01/2005 16:06:01
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:
00975808
Vues:
27
Create a index tag on SubStr(faiuniqueid,4,4) and change your select:
lcYear=STR(YEAR(DATE()),4)
Select faiuniqueid From fai_required Where SubStr(faiuniqueid,4,4) = lcYear InTo Cursor myFAIlist
By including the date() into the where, VFP will have to evaluate date() for every record!


>I have a uniqueindex made like FAI2005-000001. It is based on the year the record was input. When a new record is added I need the last unique id plus 1. My SQL statement I use is:
>
>Select faiuniqueid From fai_required Where Val(SubStr(faiuniqueid,4,4)) = Year(Date()) InTo Cursor myFAIlist
>
>This sql statement runs very slow on our older computers. Is there a way to do this different to make it faster?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform