MS Access Format() Function
❮ MS Access Functions
Example
Format the "BirthDate" column to a long date:
SELECT Format(BirthDate, "Long Date") AS FormattedBirthDate
FROM Employees;
Try it Yourself »
Definition and Usage
The Format() function takes a date expression and returns it as a formatted string.
Syntax
Format(expression, format, firstdayofweek, firstweekofyear)
Parameter Values
| Parameter |
Description |
| expression |
Required. The date expression to format |
| format |
Optional. The format to apply to the expression.
| Format |
Description |
| General Date |
Displays date based on your system settings |
| Long Date |
Displays date based on your system's long date settings |
| Medium Date |
Displays date based on your system's medium date settings |
| Short Date |
Displays date based on your system's short date settings |
| Long Time |
Displays time based on your system's long time settings |
| Medium Time |
Displays time based on your system's medium time settings |
| Short Time |
Displays time based on your system's short time settings |
|
| firstdayofweek |
Optional. Specifies the first day of the week. If omitted, Sunday is the
first day of the week.
Can be one of the following values:
| Value |
Description |
| 0 |
Use the NLS API setting |
| 1 |
Sunday |
| 2 |
Monday |
| 3 |
Tuesday |
| 4 |
Wednesday |
| 5 |
Thursday |
| 6 |
Friday |
| 7 |
Saturday |
|
| firstdayofyear |
Optional. Specifies the first week of the year. If omitted, the week
that contains January 1 is the
first week of the year.
Can be one of the following values:
| Value |
Description |
| 0 |
Use the NLS API setting |
| 1 |
The week that contains January 1 |
| 2 |
The first week that has at least 4 days in the year |
| 3 |
The first full week of the year |
|
Technical Details
| Works in: |
Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access
XP, Access 2000 |
❮ MS Access Functions