>>Hi everybody,
>>
>>We have a DTOS function, but what we should use for datetime fields? My colleague was using ttoc and the search expression didn't work. I suggested to use DTOS(TTOD(datetimefield)) and it solved the problem. However, I'm wondering what is the correct approach here?
>>
>>Thanks in advance.
>
>It all depends of what is the INDEX Expression, If table is indexed by DTOS(DateTimeField) you must use DTOS(). There is no need to use DTOS(TTOC()), because DTOS() works with DateTime type as well as with Date type.
Thanks, the index expression would be easier then. But I just recalled, that ttoc has parameters. And yes, here it is
=============================================
1
Specifies that TTOC( ) return a Character string in a format suitable for indexing. The character string has a 14 character yyyy:mm:dd:hh:mm:ss format that is not affected by the current settings of SET CENTURY or SET SECONDS.
========================================
In our case the datetime field always hold just date, so we may use DTOS instead aanyway.
Thanks for ideas to everyone.
If it's not broken, fix it until it is.
My Blog