Last updated: August 25, 2026.
The Access DateDiff function returns the number of specified interval boundaries between two date values.
Syntax
DateDiff(interval, date1, date2 [, firstdayofweek [, firstweekofyear]])| Interval | Meaning |
|---|---|
yyyy | Year |
q | Quarter |
m | Month |
d | Day |
ww | Calendar week |
h, n, s | Hour, minute, second |
Query examples
DaysOpen: DateDiff("d", [OpenedAt], Date())
MinutesElapsed: DateDiff("n", [StartedAt], Now())
FullYears: DateDiff("yyyy", [BirthDate], Date())DateDiff("yyyy", ...) counts year boundaries; it does not automatically calculate a person’s completed age. Week calculations also depend on the optional first-day and first-week arguments. See Microsoft’s DateDiff reference for all interval rules.
Need to replace an Access database application? Explore a web-based migration path with PHPRunner.