Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index on Date field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00391970
Message ID:
00392017
Vues:
14
>I need to create a primary index on an internal code + a date (each code can have multiple dates). I have :
>
>INDEX ON lcCode + DTOC(ldDate) tag code_date
>
>But when I do seeks for records I know are there, it returns .f. I'm not sure if the SET DATE setting has anything to do with it.

As George said, you do need use DTOC(,1) or DTOS(). DTOC() adheres to your SET DATE setting but using the ,1 overrides this and puts it into the format YYYYMMDD.

As for efficiency, I ran a few tests and got mixed results. DTOC(,1) was faster some of the time and DTOS() was faster other times. Either way, the difference was less than 4% one way or the other.

As for you not finding your record, are you specifying the date part using the correct format?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform