DatePart function (Access custom web app)
Returns a numeric value that represents the specified date part of the specified date.
Note
The cloud storage feature described in this article is no longer supported in Office 2013 and Office 2016 and may result in the following error: Sorry, we're having server problems, so we can't add <service> right now. Please try again later. For cloud storage for Office Online, Office for iOS, and Office for Android, look into our Office Cloud Storage Partner Program.
Syntax
DatePart (DatePart, Date)
The DatePart function contains the following arguments.
Argument name | Description |
---|---|
DatePart |
The part of Date (a date or time value) for which an integer will be returned. Refer to the Remarks section for the list of valid abbreviations. |
Date |
An expression that can be resolved to a Date/Time value. The Date argument expression, column expression, user-defined variable or string literal. |
Remarks
The following table lists all valid DatePart arguments.
DatePart |
---|
year |
quarter |
month |
dayofyear |
day |
week |
weekday |
hour |
minute |
second |
millisecond |