Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index on Date field
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00391970
Message ID:
00392017
Views:
15
>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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform