Time variables

D

Daniel

Hello,

Typically when working with date variable I declare them 'as Date'. What
should I declare time variable? Are they too considered 'as Date'?

Daniel
 
D

Douglas J. Steele

Yes, they are.

Be aware, though, that Access doesn't really support time variables. The
Date data type is intended to be used for a timestamp: an exact date and
time representation (under the covers, the Date data type is an 8 byte
floating point number, where the integer portion represents the date as the
number of days relative to 30 Dec, 1899, and the decimal portion represents
the time as a fraction of a day). If you assign simply a time to a Date
variable (as in dtmVariable = #08:00:00#), Access will treat that as 8 AM on
30 Dec, 1899.
 
R

ruralguy via AccessMonster.com

Hi Danial,

Both Date and Time are contained in a Date (DateTime) variable. Yes,
declare your time variable as a Date variable.
 
Top