Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with primary key
Message
 
À
25/07/2005 07:13:52
Mike Yearwood
Toronto, Ontario, Canada
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 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01035448
Message ID:
01035665
Vues:
11
Thanks Mike,
That is a thorough implementation of what I was talkink about with full error checking. Looks great.



>Hi Burt
>
>Check out this thread...
>
>http://vmpdiscussion.visionds.com/ShowMsg.wwt?MsgId=1A80P53R6
>
>>You could also use the DTOS() function, which does the same thing as DTOC(,1), but is more readable. This will make your program logic easier to follow in the future.
>>
>>DTOC stands for Date TO Character
>>DTOS stands for Date TO String.
>>
>>DTOC(,1) gives the same functionality as DTOC(,1), but you need to remember what the ',1' parameter does for you.
>>
>>Thus the result I would recommend would be
ssnumber + DTOS(orderdate)
>>
>>>To create a compound index key, you've to convert all fields to the character type.
ssnumber + DTOC(orderdate,1)
Notice the second parameter used in DTOC(,1) function. It converts a date to the text format suitable for an index key.
>>>
>>>
>>>>I am trying to set a primary key for a character field and a date field through an expression. I have thhe following:
>>>>
>>>>ssnumber+orderdate
>>>>
>>>>ssnumber is a character field and the orderdate is a date field. When I try and save it I get the following:
>>>>
>>>>Operator/operand type mismatch
>>>>
Burt Rosen
Software News & Views, Editor in Chief and Writer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform