Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with primary key
Message
 
To
25/07/2005 07:13:52
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01035448
Message ID:
01035665
Views:
12
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
Previous
Reply
Map
View

Click here to load this message in the networking platform