Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index
Message
De
14/03/2007 11:43:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
14/03/2007 11:40:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Index
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01203424
Message ID:
01203437
Vues:
10
>>I have an index on a date field that looks like thie: dtoc(< date >).
>>I have a view which I use in a form that is used to add/update that table.
>>
>>When I call the tableupdate I get the following message.
>>Error building key for index "< cdx file >" tag "< tag name >".
>>
>>Is there a setting or a work around for this problem?
>
>
>I found it.
>
>"DTOC(dExpression | tExpression [, 1])
>
>1
>Returns the date in a format suitable for indexing. This is particularly useful for maintaining the table records in chronological sequence.
>
>For example, to order table records in entry sequence, you could issue this command:
>
>INDEX ON DTOC(gdInvDate, 1) + gnInvTime TAG Timeindx"
>
>This resolved the issue.

Or, a little simpler, dtos(gdInvDate) + gnInvTime.

The problem is that dtoc() (without the second parameter) might give you different values on different runs, so it is not at all suitable for indexing. About as bad as having a variable-length index expression.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform