sententia
Home    Blog

Formatting Date and Time in Ms Access

from http://office.microsoft.com/en-us/access-help/add-and-customize-date-and-time-formats-HA010078108.aspx#_Toc272229486


Character Description
Date separator Controls where Access places the separator for days, months, and years. Use the separator defined in the Windows regional settings. For example, in English (U.S.), use a slash (/).
Time separator Controls where Access places separators for hours, minutes, and seconds. Use the separator defined in the Windows regional settings. For example, in English (U.S.), use a colon (:) .
c Displays the general date format.
d or dd Displays the day of the month as one or two digits. For one digit, use a single placeholder; for two digits, use two placeholders.
ddd Abbreviates the day of the week to three-letters.
dddd Spells out all days of the week.
ddddd Displays the Short Date format.
dddddd Displays the Long Date format.
w Displays a number that corresponds to the day of the week.
m or mm Displays the month as either a one-digit or two-digit number.
mmm Abbreviates the name of the month to three-letters. For example, January appears as Jan.
mmmm Spells out all month names.
q Displays the number of the current calendar quarter (1-4). For example, if you hire a worker in May, Access will display 2 as the quarter value.
y Displays the day of the year, 1-366.
yy

Displays the last two digits of the year.

 Note   We recommend entering and display all four digits of a given year.

yyyy Displays all digits in a year in the range 0100-9999.
Time separator Controls where Access places the separator for hours, minutes, and seconds. Use the separator defined in the Windows regional settings. For information about those settings, see the section, Change the Windows regional settings to change how dates and times are displayed.
h or hh Displays the hour as one or two digits.
n or nn Displays minutes as one or two digits.
s or ss Displays seconds as one or two digits.
tttt Displays the Long Time format.
AM/PM Displays 12-hour clock values with a trailing AM or PM. Access relies on the system clock in your computer to set the value.
A/P or a/p Displays 12-hour clock values with a trailing A, P, a, or p. Access relies on the system clock in your computer to set the value.
AMPM Displays 12-hour clock values, but uses the morning and afternoon indicators specified in the Windows regional settings. For information about those settings, see the section, Change the Windows regional settings to change how dates and times are displayed.
Blank space, + - $ () Use blank spaces, some math characters (+ -), and financial symbols ($ ¥ £) as needed anywhere in your format strings. If you want to use other common math symbols, such as slash (\ or /) and the asterisk (*), you must surround them in double quotation marks.
"Literal text" Surround any text that you want users to see in double quotes.
\ Forces Access to display the character that immediately follows. This is the same as surrounding a character in double quotation marks.
* When used, the character immediately after the asterisk becomes a fill character — a character used to fill blank spaces. Access normally displays text as left aligned and fills any area to the right of the value with blank spaces. You can add fill characters anywhere in a format string, and Access will fill any blank spaces with the specified character.