Date/Time data type

D

David Cleave

Hello all

Does the date/time data type store both time and date, or
just a time or just a date?

I ask because I want to be able to date-and-time-stamp
records at the time of creation. So, a new record is
created and some code runs which populates a field or
fields to record the date and time of its creation.

So, do I need to create two fields, one to store the date
of creation and another to store the time of creation, or
just the one field to store both?

Thanks for your help

David
 
A

Allen Browne

Just one field for both date and time.
Set its DefaultValue property to:
=Now()

Internally, Access uses a fractional number to store the date and time. The
integer part represents the date, and the fraction part is the time of day
(e.g noon is 0.5 of a day; 6am is 0.25).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top