Microsoft Office Tutorials and References
In Depth Information
Date/Time
Access Data Types
This string translates as the following instructions: “Display the four-digit year,
followed by a dash, followed by a two-digit month number, followed by another dash,
followed by a two-digit day number.” You’re free to put these components in any
order you like, but this example defines them according to the ISO date standard.
You can also control how to display the year, day, and month components. You can
use month abbreviations or full names instead of a month number (just replace the
mm code with something different).
If you apply this format string to a field that contains the date January 1, 2010, then
you see this in the datasheet:
2010-01-01
Remember that regardless of what information you choose to display or hide,
Access stores the same date information in your database. Table 26-4 shows the basic
placeholders that you can use for a date or time format string.
Table 26-4. Date and time formatting codes
Displays (January 1, 2010,
1:05:05 p.m.)…
Code
Description
d
The day of the month, from 1 to 31, with the
numbers between 1 and 9 appearing without a
leading 0.
1
dd
The day of the month, from 01 to 31 (leading 0
included for 1 to 9).
01
ddd
A three-letter abbreviation for the day of the
week.
Fri
dddd
The full name of the day of the week.
Friday
m
The number value, from 1 to 12, of the month
(no leading 0 used).
1
mm
The number value, from 01 to 12, of the month
(leading 0 used for 01 to 09).
01
mmm
A three-letter abbreviation for the month.
Jan
mmmm
The full name of the month.
January
yy
A two-digit abbreviation of the year.
10
yyyy
The year with all four digits.
2010
h
The hour, from 0 to 23 (no leading 0 used).
13
hh
The hour, from 00 to 23 (leading 0 used for 00
to 09).
13
:n
The minute, from 0 to 59 (no leading 0 used).
5
 
Search JabSto ::




Custom Search