Mensaje
De
30/09/2016 02:56:11
 
General information
Foro:
Visual FoxPro
Category:
Bases de datos, tablas, vistas, índices y SQL
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
ID de la conversación:
01641508
ID del mensaje:
01641525
Views:
60
>>>>>I'm wanting to store a datetime as compactly as possible. When you create a datetime field in a table, it takes 8 bytes but if you do a TTOC(), it takes 20 characters. Is there a way of getting that 8 byte value from the DBF and easily convert it back and forth?
>>>>
>>>>I don't understand what you're asking. Storing as DateTime is the compact way.
>>>>
>>>>Tamar
>>>
>>>I should have been clearer - I need to store this as a text field in a lookup table holding all my settings. I was hoping to store it in a few characters without making up my own scheme.
>>
>>TTOC(DATETIME(),1)
>>
>>is the string format of a time to have it index~ and sortable.
>
>Not bad - only 14 characters, easily converted to integer and sortable - Thanks!

Don't convert to an integer

Digits in an int = 9.33
?log10(2147483647)
You could convert to currency as the number of digits for the integer part of currency is 14.9649
?log10($922337203685477)
But that is also taking 8 bytes - as the DateTime field
Gregory
Previous
Next
Responder
Mapa
Ver