Access DatePart Function

Last updated: August 25, 2026.

The Access DatePart function returns a selected component of a date, such as its year, month, quarter, or week number.

Syntax

DatePart(interval, date [, firstdayofweek [, firstweekofyear]])
IntervalReturnsExample
yyyyYearDatePart("yyyy", #8/25/2026#) → 2026
qQuarter3
mMonth8
dDay25
wwWeek of yearDepends on week settings

Query example

OrderYear: DatePart("yyyy", [OrderDate])
OrderQuarter: DatePart("q", [OrderDate])
ISOStyleWeek: DatePart("ww", [OrderDate], vbMonday, vbFirstFourDays)

Week results depend on firstdayofweek and firstweekofyear. Specify both arguments when a report must follow a defined calendar rather than the user’s system defaults. Microsoft’s Access date-function guide compares the available choices.

admin

admin

Leave a Reply

Your email address will not be published.