[AccessD] Number vs text data type

Henry Simpson hsimpson88 at hotmail.com
Sat Oct 18 18:33:29 CDT 2003


Christian:

If one were using an fluctuating base 365/366 number system, that would be 
close, but that is unnecessarily complicated.  The integer portion is 
usually a count of days before or after the date:

?format(cdate(0), "dd mm yyyy")
30 12 1899

which is December 30, 1899.  Negative numbers are days prior to that day.

If you replace the 0 with a 2, you get January 1, 1900 and if you use 367, 
you get the first day of the 20th century, January 1, 1901.  There's 
Microsoft logic shining as it often does.

The numeric portion after the decimal represents the fraction of the date 
and can commonly be formatted as hours, minutes and seconds.  The 8 byte 
double in which the following date/time is stored is significantly smaller 
than the 34 bytes (68 unicode) of the following string representation:

?format(cdate(366.7), "dddd dd, mmmm yyyy, hh:nn:ss")
Monday 31, December 1900, 16:48:00

Just because you can have some fun and mess around with calculations doesn't 
mean that it doesen't make sense to store dates as numbers:

?(#sept 3 2001#)  * 2
74274
?#sept 3 2001# * #July 14 1881#
-250414791

It is equally easy to be idiotic with strings representing numbers:

?"4" + "4"
44

But it does make a great deal of sense if you want to be warned 10 days 
before a birthday or meeting because the date of the notification is simply 
the record date minus 10.

?#Jan 15, 2004# - 10
1/5/04

If you have a calendar application, this makes it very easy to give a user 
the ability to simply enter a number of days warning he wants prior to a 
calendar date.

I don't get the point of your post unless you think you are disagreeing with 
me.  You're preaching to the choir.

Hen

>From: "Brock, Christian T, HRC-Alexandria" 
><Christian.Brock at hoffman.army.mil>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: "'Access Developers discussion and problem solving'" 
><accessd at databaseadvisors.com>
>Subject: RE: [AccessD] Number vs text data type
>Date: Thu, 16 Oct 2003 09:32:53 -0400
>
>A date is a number.  It is the count of years, etc from a given start 
>point.
>
>Christian Brock
>
>-----Original Message-----
>From: Henry Simpson [mailto:hsimpson88 at hotmail.com]
>Sent: Wednesday, 15 October 2003 21:56
>To: accessd at databaseadvisors.com
>Subject: RE: [AccessD] Number vs text data type
>
>
><SNIPPED>
>Also, things like spaces, parentheses and hyphens can be used in formatting
>a numeric
>value.  Why do you suppose Microsoft and other software vendors store dates
>as numeric values?  Speed, efficiency and format flexibility.
>
>Hen

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



More information about the AccessD mailing list