Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I learn more about How Access deals with time?

Status
Not open for further replies.

FiendClub

Technical User
Jul 29, 2002
4
0
0
US
I'm running into problems with time in Access. Can anyone point me to were I can learn how databases handle records on a day to day basis.
The whole concept of Time in a database structure eludes me.
I can't really even explain what I need to know. I am a novice designing a database for a 365 day a year circulation publication and need find more information on this issue.
Thanks you for your reply.

 
I do not know of any specific reference to the subject which goes into a lot of detail. Perhaps because there really isn't much to know or learn.

The date/time storage for most modern programming is simply a "double" or floating point value. The integer portion is the Number of days from the start / reference while the fraction is the part of the day. For all Ms., the first day is easily displayed:

? CDate(1)
12/31/1899

Using much the same technique, you can see the 'time' portion:

for xx = 1 to 24: ? xx, Format(xx/24, "#.###"), CDate(xx/ 24): Next xx
1 .042 1:00:00 AM
2 .083 2:00:00 AM
3 .125 3:00:00 AM
4 .167 4:00:00 AM
5 .208 5:00:00 AM
6 .25 6:00:00 AM
7 .292 7:00:00 AM
8 .333 8:00:00 AM
9 .375 9:00:00 AM
10 .417 10:00:00 AM
11 .458 11:00:00 AM
12 .5 12:00:00 PM
13 .542 1:00:00 PM
14 .583 2:00:00 PM
15 .625 3:00:00 PM
16 .667 4:00:00 PM
17 .708 5:00:00 PM
18 .75 6:00:00 PM
19 .792 7:00:00 PM
20 .833 8:00:00 PM
21 .875 9:00:00 PM
22 .917 10:00:00 PM
23 .958 11:00:00 PM
24 1. 12/31/1899

The various date functions provided by Ms. are really just strange and obscure formatting of basic operations on these values. The date functions actually just 'do the math' in a more-or-less simplistic manner, with some interesting 'twists', such as datediff only really counts the interval boundaries crossed, resulting in some weird interpertations, like:

? Datediff("Y", #12/31/01#, #1/1/02#)
1

All of this is quite lucidly documented in Ms. Speak throughout the various help topics in Ms. Applications, but of course they are only useful to those who have the ability to read Ms. Speak.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top