If it's actually stored in a Date/Time field, you don't. Rather you format it
to look like you want. Dates are actually stored as numbers which don't look
anything like dates anyway. Today is stored at 40115 which is that many days
since 30 December 1899!
To make it LOOK like you want, use the Format function. In a query it would
look like this with the appropriate field where it says TheDateField .
That is more about format than storage. As example, you don't really want to
change the bits and bytes in the computer, right? Same for date. Let the
dates (and time) be stored the way Access 'likes' them, and if that does not
match your needs, you can FORMAT the presentation. As example, in the
Immediate Window (Ctrl_G, and you should see a small window there, with its
caption title "Immediate"), type:
? FORMAT( now, "yyyymmdd" ) [ enter ]
(result may vary, if you do it on another date, for sure )
So, define you field as date time and know your data is then in US format by
default and use a FORMAT if you wish another representation. Note that the
result of a format is technically a STRING, not a date, so you can't make
computation (such as difference in day between two 'dates' ) on the
formatted representation, while you can on a default date_time type
In general that is a very bad idea. How a field's value is
stored has little or nothing to do with how it is displayed.
To view your data, you should create a form or report with
an appropriate layout and text boxes with their Format
property set to display the date however you want. Even if
you insist that you have to see the data in table view, you
can set the field's Format property to:
to display the value the way you want.
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.