>I need to create a primary index on an internal code + a date (each code can have multiple dates). I have :
>
>INDEX ON lcCode + DTOC(ldDate) tag code_date
>
>But when I do seeks for records I know are there, it returns .f. I'm not sure if the SET DATE setting has anything to do with it.
As George said, you do need use DTOC(,1) or DTOS(). DTOC() adheres to your SET DATE setting but using the ,1 overrides this and puts it into the format YYYYMMDD.
As for efficiency, I ran a few tests and got mixed results. DTOC(,1) was faster some of the time and DTOS() was faster other times. Either way, the difference was less than 4% one way or the other.
As for you not finding your record, are you specifying the date part using the correct format?
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao