>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.
Sylvain Demers