>Hilmar
>
>My experience is that Sergey is always right. I will try ttoc(created,1) without really understanding why that should be the right answer.
>
>Thanks to both of you.
>
>Colin
Well, I would say the explanation is something like this:
ttoc() without a second parameter is designed for displaying data, not for indexing.
ttoc() with the second parameter is specifically designed for indexing: a) The return value has a consistent format, not dependent on SET DATE, etc., b) The return value will be sorted correctly, since the most significant datum comes first: year, month, day, hour, minutes, seconds.
In part (a), perhaps you are having trouble with private datasessions. Instead of solving this, just go ahead and use the second parameter for correct indexing.
BTH, for correctly indexing date-only fields, you can use dtos().
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)