Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dtoc() in index causing not to find record I think
Message
From
24/08/1999 17:06:39
 
 
To
23/08/1999 12:39:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00256634
Message ID:
00257322
Views:
27
>>Help! I have a file that has a 25 digit customer id in it - clid
>>It has a billing date (a date field) - billdate
>>
>>I have an index - clid1 that is clid + dtoc(billdate)
>>I can reindex this file sometimes and everything works okay.
>>Then sometimes it will not find a record with this key. Has anyone
>>heard of a problem with dtoc() in a key, or Visual Foxpro 5.0
>>loosing indexes.
>>Any help is appreciated.
>>
>>Brad Trim
>>ssc@worldnet.att.net
>
>Hi Brad,
>
>DTOC() depends on your current date settings for output. My guess is that when you seek, you are not using the same date format that you used when you reindexed. When everything works fine, it's probably because you reindexed in the same date format.
>
>DTOC() should not be used for indexes because of that dependency. Use DTOS() instead, which always returns in the format yyyymmdd, no matter what your settings are.

PMFJI: I agree. Our most annoying Y2K conversion issue last summer was some truly stupid index tag definitions with DTOC() in them, which as you say is dependent on the setting of CENTURY. I strongly urge a rewrite to eliminate all use of DTOC() in any and all index definition(s) in your system.

Rob
Previous
Reply
Map
View

Click here to load this message in the networking platform