BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Year only date field

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
Tumurbaatar S.
Guest





PostPosted: Tue Oct 14, 2003 9:56 am    Post subject: Year only date field Reply with quote



What field type I should to use if a field contains
only year values: date column or number? And why?


Back to top
Jayme Jeffman Filho
Guest





PostPosted: Tue Oct 14, 2003 5:13 pm    Post subject: Re: Year only date field Reply with quote



Hi Tumurbaatar,

It depends on how the database system you are using stores the date and
number types, choose the one which uses less disk space.

HTH

Jayme.


"Tumurbaatar S." <tumurbaatar (AT) datacom (DOT) mn> wrote

Quote:
What field type I should to use if a field contains
only year values: date column or number? And why?





Back to top
Dwayne
Guest





PostPosted: Wed Oct 15, 2003 5:26 pm    Post subject: Re: Year only date field Reply with quote



Tumur>>What field type I should to use if a field contains
only year values: date column or number? And why?<<

That really depends upon the way the data is going to be used and
the programmer.
I have used int, as well as char. Since a 16bit integer is good up to
32000+ for it handles a 4 digit
year quite well. A char string will work well too. The biggest thing I
would say, what are you going to do with it? compare? sort? manipulate?.
It is easy to compare integers and quite fast...

if (int a)<(intb) then....
little slower to do
if(strncmpi(a, b,strlen(a(or)b))==0) then....(because I do not know if
you are saving 4 digit years or 2).

Maybe some others will have a more percise answer.

Dwayne




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.