>Hi Mark
>>
>>ldBgnDate = {^2000-01-01} && or the value of some form controls
>>ldEndDate = {^2000-01-31}
>>
>You are very helpfull, but still some questions.
>Would you be so kind to explain the notation: {^2000-01-31}
>I used ctod("31/01/2000") I have seen your notation in Language
>Reference by DTOC function but it is not explaned.
>
>Must I use an Index for the command "set filter to"
>
>Greetings
>
> Ben
Your way of setting a date value is fine as well. What I showed came about for Y2K and the VFP StrictDate feature. From VFP Help StrictDateProperty topic:
A caret (^) can be included as the first character in a date to specify year-month-day date ordering, overriding the order specified by the DateFormat property or SET DATE.
Since your date formatting is dd/mm/yyyy, you can also define a date as {31/01/2000}. The braces {} are recognized by VFP as date delimiters. So an empty date would just be {}.
To optimize SET FILTER TO BETWEEN(datefield, date1, date2), you do need an index on the DateField. Otherwise, browsing the table with the filter set to a date range can be painfully slow.
Mark McCasland
Midlothian, TX USA