Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any reason to store time in 8-char field?
Message
 
 
To
03/05/2008 16:12:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01314637
Message ID:
01315014
Views:
13
>>Hi,
>>
>>I need to store time in a new field (I don't use TimeDate field yet). I don't really need to store seconds; hours and minutes is all I need. So, initially, I am thinking of making the new field 5 char long (e.g. "02:12"). But I am wondering, can someone offer a reason(s), why it might be better to create this field as 8 characters and store the seconds, even though I won't use them now. In the future update I will convert this database to a SQL Server and probably will combine another DATE field with this new TIME field into one DateTime.
>>
>>Thank you in advance for any input.
>
>5 is good (at least). Don't go under 5 because you may need time values like 11:15 which have 4 digits. Don't try to save : if you think easy casting and future. 8 and 11 are optional and could be done later too by simply altering the size.
>
>ie:
>cast(myTime as datetime) simply works both in VFP and SQL server when you go with hh:mm format.
>cast('0:0' as datetime) works in SQL server but not '0' as it does in VFP.
>Cetin

Thank you, Cetin.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform